Basic Unix Commands - Part 1
Similar to using DOS in windows, in Linux and Mac OS X operating systems, you can use the terminal using Unix Commands. Here I will just quickly highlight the basics of how to use unix commands.
Once you open the terminal, you can start typing commands. After typing a command hit the enter key to execute it. When a command is finished executing it will display another prompt where it will wait for another command. Some commands will output things into the terminal window and others won't.
Navigating the File System
Using unix commands, you can navigate through all your files and folders using just text. When you open a terminal window you start in your user account's home directory. If you type the command ls you will see all files and folders within your home directory listed.
Unix commands also have options that you can set on them. For example the command ls -l would also list all your files but include more information like size and date.
Changing your current directory
To change your current direction you use the command cd [directory]where [directory] is the path to the directory you want to move to. For example if my current directory contains a folder called "Documents" and I want to move into this folder I would type cd Documents.
The command cd .. would move me to the parent directory of the current directory and cd ../../ would move me to the parent of the parent directory. A command like cd Documents/files would move me into the files directory that is inside the Documents directory. And you can use all different combinations of these like cd ../Music/songs would move up one directory and then into the Music/songs directory. If you try to move to a directory that doesn't exist you will get a message output that says "No such file or directory".
Deleting files and folders
To delete files in Unix you use the command rm [file] where [file] is the name of the file you want to delete.
To delete an entire directory and all the files contained in it, you use rm -r [directory] where [directory] is the path the directory you want to delete. Be very careful with this command as you could accidentally delete a lot of files all with the one command.