If you are looking to get the most power out of your Mac, you need to embrace the Mac’s terminal and learn some helpful terminal commands. Most users are fine using menus and the mouse to control settings, files, and folders, but if you want to get down under the hood of macOS, terminal can get you there quickly and get the job done. 

What Is Mac Terminal?

Mac terminal is an included program on macOS that allows you to use Unix commands (think DOS) to perform dozens of functions quickly and easily without any interference from the operating system. The technical term for it is a command-line interface (CLI). Using the terminal can be very powerful and efficient, but also dangerous. 

Terminal is sometimes compared to Windows command prompt program. They are similar; however terminal uses Unix commands to function. Windows uses its own command prompt language. 

Be very careful when using terminal commands. If misused, you could end up deleting files and folders faster than you can react (to the point where you might need to restore it from a backup.) 

Some users (think IT administrators and developers) use the terminal because it can be faster than the graphical interface most of us use and, the real kicker, it allows access to functions not available through the regular macOS interface. 

How to Open Terminal (Command Prompt) on Mac

You can use terminal by opening Finder > Applications > Utilities > Terminal. A window will open, and you will see a command prompt ending with a $. The command line shown is ComputerName:CurrentDirectory ~Username$. At the top of the window, you will see the word Bash; it stands for ‘Bourne again shell.’ Bash is the language used for terminal on a Mac.

When using terminal commands, precision matters (including capitalization), so be careful of every character, even spaces.

You are ready to start typing commands.

Keyboard Shortcuts to Use With Terminal

After every command, press the Return key to execute it. You can also copy and paste into the terminal window. 

Working With Files and Folders

Special Commands

Control Permissions

Network and Server Commands

As a bonus to our terminal cheat sheet, here are some of the most popular terminal commands to get the most out of your Mac.

Show/Hide Hidden Files and Folders

There are times when you need to view hidden files and folders on a Mac, and there is a command for that.

defaults write com.apple.finder AppleShowAllFiles TRUEkillall Finder

To reverse the command above, change TRUE to FALSE.

Download Files From the Internet

To quickly download a file from the internet use the command below.

curl -O URL of the file you want to download

Change the Default Location for Screen Shots

Not everyone wants their screenshots saved to the Desktop. With a single command, you can change where they go.

defaults write com.apple.screencapture location path to folder where you want screenshots to be saved

Press Return.

killall SystemUIServer

Change the Default File Type for Screenshots

If you want to change the default file type of screenshots, use the following command.

defaults write com.apple.screencapture type JPG

Delete All Files in a Folder

You can easily delete all files in a folder using a single command. However, be warned there is no undo button, once you press Return, the files are gone.

rm -R foldername

Read the Manual

Bash has a complete manual built-in, and you can access the pages through terminal using the “man” command.

You must include the entire path for the folder name.

For example, if you wanted to know how to use the cd command, you would type in: 

man cd

You can scroll through pages of the manual by pressing the spacebar. 

These are the most common commands, but there are thousands (you can even combine them into one series of commands) you can try in terminal to make your Mac experience more powerful and more enjoyable. But remember, there’s a lot of power in these commands so make sure you type them in correctly.

Get the Latest Tech News Delivered Every Day

  • How to Enable and Use the Hidden Finder Path Bar

  • View Hidden Files and Folders on Your Mac With Terminal

  • How to Delete a File in Terminal on Your Mac

  • How to Turn off Mouse Acceleration on Mac

  • How to Use Terminal on a Mac

  • What Is a DIRECTORY File?

  • How to Use the Netstat Command on Mac

  • How to Restore Deleted Files From the Recycle Bin

  • What Is Windows Terminal & How Does It Work?

  • Use Terminal to Speed Up Your Mac

  • How to Back Up Your iPhone to an External Hard Drive

  • How to Delete Temporary Files in Windows

  • How to Make a Bootable Flash Installer of OS X or macOS

  • How to Open Terminal on Mac

  • How to Show or Hide Hidden Files and Folders

  • How to Install Android Debug Bridge (ADB)

  • Facebook

  • Twitter

Hit Refresh on Your Tech News

  • About Us

  • Privacy Policy

  • Editorial Guidelines

  • Terms of Use

  • Careers

  • Advertise

  • Contact

  • EU Privacy

  • NEWS

  • HOW TO

  • FEATURES

  • ABOUT US