Introduction To Terminal – Noob2Pro #21 2

Noob2Pro

Share
Introduction To Terminal – Noob2Pro #21

Hey

Terminal, I think, is one of the best apps for the Mac, most people would probably disagree. You can access a lot of system files and folders as well as complete high level task which don’t need a user interface. Gaining an advance knowledge of Terminal takes a long time. I have learnt how to use Terminal over the last three years and I still regard myself as a learner. This post will introduce you to a couple of basic commands and how to change default settings on apps (which I feature quite a lot).

Terminal is found in the Utilities folder. The screen shot below shows you a basic window, you can change all of the settings on how Terminal looks through the preferences. Just about everything you do with Terminal is typed. You enter what you want to do and you press enter. The results will then come back to you in the Terminal window.

Terminal

You can move around files and folders with the “cd” command. This means change directory. For example “cd downloads” will take me to the downloads folder (in the current folder, you start at the home folder). You can also type “cd downloads/websites” this will take me to the websites folder in the downloads folder. If you type “cd ../” this will take you a level up.

If you want to view what is in a folder type “ls”. This will show you the contents of a folder. You will find you use the ls and cd command quite frequently when moving around your Mac.

Copying files is done with a different command, “cp”. Simply type “cp file1.txt file2.txt”. This will copy file1 and name it file2. You can also move files with the “mv” command, using the same syntax. You can combine directories with copy and move commands, to move files to different places. For example “mv file1.txt ../documents/file2.txt”. This will move file1 to the websites folder in a folder above the current one (for example from downloads to documents in your home folder) and rename it file2.txt. The mv command can also be used to rename files.

The final mini command I would like to post is rm. This will remove a file from your file system. You usually use this file that are a bit stubborn. Simply type, “rm -rf file1.txt”. The -rf bit will allow you to remove the file easily. These are known as options which allow you to change the way a program works in Terminal. To find out more about options you will need to access the manual page (known as a man page). To do this simply type “man rm” a second page will come up. You can scroll through it with the arrow keys. This will tell you all you need to know about a command in Terminal and how to change it.

I frequently post Terminal tips and tricks on this site. Most of these are to change the default settings on a program. These are done in Terminal. To apply the setting simply type the command I give into Terminal and press enter. For example “defaults write com.apple.dock no-bouncing -bool TRUE; killall Dock”. This command is typed which allows you to stop the dock from bouncing. Notice the semi-colon (;). This separates the two commands, when you hit enter it will run the second one after the first.

Learning Terminal is quite hard. I really can’t put a whole load of knowledge into a simple post (I am also running out of time in the day). The best way to learn is to find a guide on the internet and read what it says. I may, at some point, produce another guide to Terminal, however don’t expect that any time soon.


If you want to keep up with the latests post from Mac Tricks And Tips I recommend you subscribe to the RSS Feed.

Where To Next?

  • Subscribe To Mac Tricks And Tips