The Terminal app on a Mac is the command line interface that allows you to use Unix commands to accomplish some tasks much faster than you could execute them using the graphical user interface (GUI). Using Terminal commands, you can open files, improve your Mac’s performance, and much more. Here’s how to use Terminal on a Mac, including some commands to get you started.

Start by Opening Terminal

Of course, your first step will be to open Terminal. There are several options to do that, but the easiest is to press Command + Spacebar to open Spotlight, then search for “Terminal.” The Top Hit should be the Terminal app. Double-click to open it.

When the Terminal window opens, you can resize it by dragging one of the corners to expand. You can also change the look of the app by going to Terminal > Preferences or pressing the Command+, (comma) keyboard combination. In the Profiles dialog box that appears, you can change the appearance of the command windows to match your style or needs.

Once your Terminal window has the appearance you prefer, then you can start using it to execute commands on the computer.

The Basics of Terminal Commands

You can do a lot of cool (and useful) things with the terminal. For example, if you really want to, you can use a Terminal command to make your Mac speak to you. But before you start, it’s helpful to know how Terminal commands are written.

Each Terminal command has three parts.

  • The command: This is the actual letters that you’ll type into the Terminal window to execute a command. Be very careful when using Terminal commands, because some commands can delete files or cause other damage to your system that might stop your computer from working.An argument: This part of a command tells which resources the command should work on. For example, should a cp, or copy, command copy this window or another?An option that modifies the output: This is a directive about where the results of a specific command should appear.

For example, if you want to move a file, you would use the command mv. The argument for that command would be the location of the file you want to move. And the output would be the location you want the file moved to. So to move a file from your desktop to your Documents file might look like this:

mv ~/Desktop/TerminalTestFile.rtf ~/Documents

That command says, “Move (the command) the file TerminalTestFile.rtf (the argument) from my Desktop to my Documents (the output).”

Rules for Using Terminal Commands

Now that you understand the basics of how to write and use Terminal commands, there are a few rules that you need to understand.

In Terminal the tilde character ~ is a shortcut for your Home folder. Both the desktop and the Documents folder exist in the Home folder.

  • When using terminal, you must always type the command and then press Enter or Return on your keyboard.You cannot use the mouse to interact with the Terminal window beyond using the Close, Expand, and Hide buttons in the upper left corner of the window.To interrupt a command that is running type Control+C.To quit Terminal without using your mouse, type Command+Q.Commands automatically execute in the last used location on your computer. If you want to specify a different location for a command to execute, you’ll need to use the cd command and a directory path to specify the location you want to command to execute in.

One more note before moving on. If you’ve never used terminal before you may be confused when you execute a command and nothing happens in the Terminal window. Don’t worry. In many cases, that’s exactly what is meant to happen.

An alternative way to change directories that’s especially useful if you don’t know the exact directory path, is to use the GUI to navigate to location you want to include and then drag and drop the directory into the Terminal window. It will not move the directory, instead, it will copy the path to the directory into the command you are writing.

For example, when you type cd ~ you’ll be returned to the Home directory. In your Terminal window, your cursor will advance to the next line with no indication that anything happened. Rest assured, you’re now back in your Home directory.

Using Terminal Commands on a Mac

With the basics out of the way, you can start using Terminal commands to move around faster and be more efficient as you’re using your computer. Here are a few Terminal commands that you can try to get your feet wet, but there are dozens of Mac Terminal commands you can use to fit nearly all your needs.

Most basic Terminal commands involve navigating files or directories on your computer. For example, you can use the command ls (that’s a lower case L, lower case S) to view a list of all the files in the current directory. So, if you are in Documents and you type ls, you’ll see a list of all the files in the Documents directory (or folder).

Syntax matters! Be sure when using Mac Terminal commands that you write them exactly as they appear here or in other lists. Capitalization and even spaces and punctuation are specific and changing one element could completely alter the outcome of the command.

You can modify (or change the output) of the ls command by adding operators. For example, ls -C sorts the files in the requested list by size.

Here are some additional basic commands you can try:

Get the Latest Tech News Delivered Every Day

  • How to Delete a File in Terminal on Your Mac

  • What Is an EX_ File?

  • How to Use Mac Terminal Commands

  • How to Redirect Command Output to a File

  • How to Enable and Use the Hidden Finder Path Bar

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

  • How to Use the Netstat Command on Mac

  • How to Turn off Mouse Acceleration on Mac

  • How to Restore Deleted Files From the Recycle Bin

  • What Is Windows Terminal & How Does It Work?

  • How to Install Android Debug Bridge (ADB)

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

  • What Is a DIRECTORY File?

  • How to Open an Elevated Command Prompt

  • How to Open Command Prompt (Windows 11, 10, 8, 7, etc.)

  • View Hidden Files and Folders on Your Mac With Terminal

  • 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