The terminal on your Mac is considered to be one of the most commonly used tools there is. However, not everybody knows what Terminal really is and how they can use it. But do not worry, because, in this article, we are going to show you the things that you need to know about Terminal. Aside from that, we are also going to teach you how to open Terminal on your Mac.
Part 1: What is Terminal on Mac?Part 2: How to Open Terminal On MacPart 2: Basic Command To Use in TerminalPart 3: Rules of TerminalPart 4: Other Advanced Terminal CommandsPart 5: Conclusion
Part 1: What is Terminal on Mac?
The Terminal on your Mac is actually the one that controls your system using a specific command depending on what you need to do. And you actually get to use the Terminal on your Mac when you are one of those people who is actually used to working on a command line such as the Unix-based system. Because if so, then you would preferably use the Terminal on your Mac.
The terminal on your Mac is also known as the command line interface. And because of this, there are actually many advantages when you are using the Terminal application on your Mac because it is normally faster and a lot more. However, for you to be able to use the Terminal application, you will be needing to know more about the basic commands and functions that you will be using in Terminal. And once that you have done that, then that is the time that you can actually dig deeper and learn more of the advanced commands. All of these can be used when you try to use the Terminal on your Mac.
Part 2: How to Open Terminal On Mac
The Terminal application can actually be found when you try to launch your Utilities folder in the Application. For you to open Terminal, you have actually two ways how you can open Terminal on your Mac.
• Method #1: Opening Terminal On Mac Using Finder
Step 1: Go ahead and click on the Finder application in your dock.
Step 2: After that, click on the Go button located in the menu bar at the top of your screen.
Step 3: After that, go ahead and click on Utilities.
Step 4: And then, go ahead and scroll down and then double-click on Terminal located in the Utilities window.
• Method #2: Opening Terminal on Mac Using Spotlight
Step 1: Go ahead and click on the Spotlight icon located at the upper-right corner of your screen.
Step 2: And then, go ahead and type in “Terminal” in the search bar. Wait for the Terminal icon to appear on your screen.
Step 3: And then after that, go ahead and double-click on Terminal, and the terminal window will be launched on your screen.
So that is it. You can do either of the two options on how you can open Terminal on your Mac. Then once you are done, you will be able to see on your screen a small window that has a white background. On the title bar, you will be able to see where your username, the word “bash” and also the dimension of the window in pixels. In case you are asking what “bash” means, it actually stands for “Bourne again shell”.
There are actually a lot of different shells that can actually be run on a Unix command and the Mac Bash is actually the one that is used by Terminal.
And in case you would want to make your window bigger, all you have to do is to click at the bottom right corner and then simply drag it away. And in case you are not comfortable with the white background and black text, then you can just simply go to the Shel menu and then select “New window”. After that, go ahead and choose from the list of options shown on your screen.
People Also Read How to Show Hidden Files on Mac
Part 2: Basic Command To Use in Terminal
As we have mentioned earlier that there is actually some basic command that you would need to know that you can use in the Terminal on your Mac. Knowing the basics is actually the key for you to be able to advance your knowledge in any aspect such as your Terminal.
Keep in mind that every command is actually composed of three elements which are as follows.
• The command itself
• The argument – which tells the command you are entering on what source are you trying to enter.
• The option that modifies the output.
An example of which is that when you try to move a file from one folder to another, you would use the command “mv” and then enter the location that you would want to move it to, and then include the name of the file and the location where you would want to move it.
You can also key in cd~/Document and then hit on the Return button for you to be able to go to your Home folder. You can also type in Is and then enter the word Return.
After that, you will then be able to see on your screen a list of files under your Documents folder – ls is the command used for listing the files.
And for you to be able to see all the commands that are available in your Terminal, all you have to do is to press and hold the Escape button and then press the Y once you see a question that asks if you would want to see them all. And if you would want to see more of the commands, all you have to do is to press Return.
Another piece of information that you need to know is that Unix normally has its very own built-in manual. And the way for you to know them all is to type in man[name of the command].
Part 3: Rules of Terminal
Just like any other program, Terminal also has its very own rules that you would be needing to follow. This way, you will be able to know if you are entering the right command or if you are having the right format.
The first thing that you need to know is that you have to make consider that every character matters. This includes the spaces on the command. So you always have to make sure that you are having the right spaces and that you have the right characters and that the letters are in the correct cases.
You can also try to use the mouse of your PC or the trackpad in the Terminal. Or you can also use the arrow keys in your keyboard for you to navigate. If ever you would want to re-run a certain command, all you have to do is to press the arrow up until you reach your target. And once that you are on your target, just go ahead and press Return. And if you would want to interrupt a certain command that is running, then all you have to do is to type in Control-C.
Also, you have to remember that the command should also be entered in the right location. So if in case that you did not include the location in the command, then it will just go on the last folder wherein you last moved something. It can also go to the last command that you enter. You can use the command cd, followed by the directory path.
Aside from that, there is also another way for you to be able to specify a certain location. All you have to do is to go to your Finder. After that, go ahead and or to the file or to the folder that you want and then drag it to the Terminal Window. Make sure that you are going to do this where you are typing the path.
Here is an example wherein you are actually going to make a new folder inside your Documents directory which can be called the “TerminalTest”.
Step 1: Go ahead and launch Finder on your Mac.
Step 2: After that, go ahead and open your Documents folder.
Step 3: And then, enter the command cd and then drag the Document folder toward your Terminal window.
Step 4: After that, go ahead and enter mkdir “TerminalTest”
Step 5: After that, go back to your Finder and then open Text Edit and make a new file called the “TerminalTestFile.rtf”.
Step 6: And then, save this to your TerminalTest folder in your Documents folder.
Step 7: Then in the Terminal window, go ahead and enter this command: cd ~/Documents/TerminalTest
Step 8: After which, press Return.
Step 9: And then, type the command ls, and then you will be able to see the “TerminalTestFile” listed on your screen.
And if you would like to change a certain file name, all you have to do is to type the following command that we are going to show you below. However, you have to make sure that you press on the Return button after every step.
Step 1: cd~/Documents/TerminalTest
Step 2: mc TerminalTestFile TerminalTestFile2.rtf
This way, you will be able to change the file name to “TerminalTestFile2” or you can change it to any name that you want. You can also have it moved by using the mv command. All you have to do is to enter this in the Terminal.
mv ~/Documents/TerminalTest TerminalTestFile.rtf ~/Documents/TerminalTest2 TerminalTestFile.rtf
Part 4: Other Advanced Terminal Commands
Once you are actually familiar with all the basic commands that you should use in Terminal, then it is time for you to move on to the advanced commands. The terminal has the ability to use different kinds of tasks on your Mac. Some of these can actually be performed using the Finder application but it is faster if you do it in Terminal. We have included here some of the samples that you can use.
• Copy Files From One Folder to Another Folder
Step 1: Go to Terminal and then type in the following command:
d itto
[folder 1][folder 2] – folder 1 actually refers to where it is coming from and folder 2 is where you are copying the files to.
Step 2: If you would want to view the file that you copied in the Terminal window, go ahead and type -v after the command.
• Download Files from the Internet
Here you will be needing to have the URL of the file that you would want to download for you to be able to use Terminal.
Step 1: Type in the command: cd ~/Downloads/
Step 2: Then type in the command: -O [URL of the file that you want to download].
If you would want to download that certain file to another folder, all you have to do is to replace the ~/Downloads/ with the name of the folder that you want. Or you can just simply drag it to your Terminal window after you type in the cd command.
• Changing The Location Of Screenshots
You can do this if you do not want to save your screenshots on your Desktop.
Step 1: defaults write com.apple.
screencapture
location [path to the folder where you want to save your screenshots]
Step 2: Then hit on the Return key.
Step 3: And then enter the command:
killall
SystemUIServer
Step 4: And then hit the Return key.
• Changing the Default Type of The Screenshots
As a default format, your Mac will save all of your screenshots in a .png file. Now, for you to be able to change this to .jpg using your Terminal, here is what you need to do.
Step 1: defaults write com.apple.
screencapture
type JPG
Step 2: Then after that, go ahead and hit the Return key.
Step 3: And then enter this command:
killall
SystemUIServer
Step 4: And then hit Return
Aside from all of these, there is still some other advanced command that you can use in your Terminal application.
Part 5: Conclusion
So, that is it. It is as simple as how you can open the Terminal application on your Mac. Also, there are a lot of things that you should learn about Terminal, especially the commands that you will be needing to use.