Mac OS X features a built-in app called the Terminal. It allows users to interact with their computer using text-based commands. The Terminal comes in handy to tweak the system settings, troubleshoot your computer, or perform tasks that would otherwise require additional software. While the Terminal is often of no interest to the casual Mac user, it remains an invaluable tool for power users.
Warning: You should be very careful when using the Terminal as the slightest mistake could lead to irreversible damage (system failure, boot issues, crashes, slowdowns, or data loss).
You can open the Terminal like any other application. Go to the Applications folder > Utilities > Terminal. Type the desired command and confirm with the Enter key. Here's a roundup of some of the basic OSX commands:
man: Display information about a specific command (type
man
followed by the name of the desired command).
cd (Change Directory): Allows you to navigate from one directory to another (type
cd/user/username
to go into your personal folder).
pwd (Print Working Directory): Display the path to the current directory.
mkdir: Create a new directory.
rm: Permanently delete a file (type
rm
followed by the name of the desired file).
cp: Allows you to copy a file (type
cp
followed by the path to the desired file).
mv: Allows you to move a file from a directory to another.
rmdir: Permanently delete a folder (type
rmdir
followed by the name of the folder/directory).
Top: View all the current processes (type
q
and press Enter to exit this menu).
df -h: This command will display a list of all mounted volumes as well as their characteristics.
ls: Display a list of all your files and folders.
ls -a: Display a list of all your files and folders, including the hidden items.
ls -a folder_name: List the content of the selected folder.
ls -l: Display a list of all your files and folders, as well as their related details (owner, permissions...).