Mac OS X Terminal

December 2016

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).

Tips & Tricks for OSX's Terminal

How to Launch the Terminal

You can open the Terminal like any other application. Go to the Applications folder > Utilities > Terminal.

How To Run Command

Type the desired command and confirm with the Enter key.

Some Useful Commands

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...).

Related :

This document entitled « Mac OS X Terminal » from CCM (ccm.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.