How to open Terminal on Mac and use it

You need to open Terminal on Mac when an instruction asks you to run a command: Terminal is the Mac’s command line, and it comes with macOS. This guide shows how to open it, how to open it right at a folder and how to start using Mac Terminal without breaking anything.

How to open Terminal on Mac

  1. Press Command-Space to open Spotlight, type «Terminal» and press Return.
  2. Or in Finder, choose Go › Utilities (Shift-Command-U) and double-click Terminal.
Finder, Utilities folder: Terminal
  1. To keep Terminal at hand, Control-click its icon in the Dock and choose Options › Keep in Dock.

A window opens with a line ending in %. That’s the prompt: Terminal waits for a command there. A new window starts in your home folder.

Open Terminal at a folder

  1. Open the folder in Finder. If you don’t see the path bar at the bottom of the window, choose View › Show Path Bar.
Finder’s View menu with «Show Path Bar»
  1. Control-click the folder’s name in the path bar and choose Open in Terminal.

Terminal opens a window that already works in that folder, so you don’t need to type its path.

Terminal also adds items to the Services menu, such as New Terminal Tab at Folder. If they don’t show up, turn them on in System Settings › Keyboard › Keyboard Shortcuts › Services.

How to use Mac Terminal: first commands

Type a command and press Return. The four commands below only show things or open a folder, they don’t change anything. Show the folder you are in:

pwd

List the files and folders in it:

ls

Go into a folder, here Documents. cd .. goes one folder up, and cd on its own goes back home:

cd Documents
Terminal after pwd, ls and cd Documents

Open the current folder in Finder:

open .

Press the Up Arrow to bring back an earlier command. Paste commands only from sources you trust: Terminal does what it’s told without asking, and rm deletes files past the Trash, with no undo.

How to stop a command or close Terminal

  • To stop a command that is running, click its window and press Control-C. This stops most commands.
  • To close one window’s session, type exit and press Return. If something is still running there, Terminal asks first.
  • To quit Terminal, choose Terminal › Quit Terminal (Command-Q).

Keep your Mac tidy

MacWashing, System Junk: Xcode junk, user caches, installers and logs found, 22.83 GB ready to be cleaned

MacWashing has nothing to do with Terminal. If you were about to delete caches with commands, System Junk shows them with their sizes and clears them without any typing, and anything debatable stays unchecked.

Free trial · macOS 14 or later

Questions and answers

Where is Terminal on Mac?

In Applications › Utilities. The quickest way to open it is Spotlight: press Command-Space, type «Terminal» and press Return.

How do I stop a command in Terminal?

Press Control-C in the window where the command runs. It stops most commands. Closing the window also ends what runs in it, after Terminal asks.

Can I break my Mac in Terminal?

Commands like pwd, ls, cd and open only look around. Commands that delete or change files do it without the Trash, and sudo runs them as an administrator, so run only commands you understand from sources you trust.