An introduction of the Terminal for Mac OS X
- cd - change directory
- ls - list the content of a directory
- pwd - parent working dir
- mkdir - create a new directory
- rm - Remove files and folders
- cp - Copy files and folders
- mv - Move files and folders
- ditto - Move files and folders (advanced)
ditto [-Options] <source> <target>
ditto [-Options] <source directory> <target directory>
ditto [-Options] <compressed archive (.zip)> <target directory>
ditto [-Options] <file(s)/folder(s)> <compressed archive (.zip)>
Copy one or several file(s)/folder(s) to another location.
Copy one directory to another.
Extract the content of a compressed archive.
Add file(s)/folder(s) to a new compressed archive (.zip).
|-c||Copies the chosen files/folders to a compressed archive (target location must end with .zip, .cpio eller .cpgz (Compressed CPIO-archives).|
|-V||Output the path to the files/folders as they are being copied.|
|-x||Extract files from a compressed archive (.zip). (source file must be a valid compressed archive like a .zip).|
|ditto myfile.txt Documents||Copies the file myfile.txt to Documents.|
|ditto Documents "Documents Backup"||Creates a copy of the directory Documents called Documents backup (Whenever you're using spaces in a path you must surround it with quotes).|
|ditto archive.zip Documents||Extract the content of archive.zip to the Documents directory.|
|ditto Documents archive.zip||Creates a new compressed archive containing the Documents directory.|
Sometimes you might not be able to perform a certain command or task from the Terminal.
This might be because you don't have the right permission to do so.
When that happens you can try to add the word "sudo" in the beginning of the line.
Sudo is an abbreviation of superuser do and means that you want to execute the following command as a user with extended permissions, most often as an Administrator. When using "sudo" you sometimes need to enter the password of the root account.
Learn more about sudo.