# Mac Terminal Commands: The Ones Worth Knowing

> The Mac Terminal commands worth knowing: moving around, files, searching, Mac-only commands like open, pbcopy and caffeinate, and safe habits for rm and sudo.

Canonical: https://monok.io/blog/mac-terminal-commands.md

[Terminal](https://monok.io/blog/category/terminal)

Nemo · October 30, 2026 · 4 min read

The Mac Terminal commands you’ll use most are a short list: `cd` to change folder, `ls` to list it, `pwd` to see where you are, `cp`, `mv` and `rm` for files, `mkdir` for folders, and `open` to hand anything to its Mac app. Add `grep` and `mdfind` for searching and `man` for help, and you can handle a lot of everyday file work from the shell. macOS also has a few commands of its own, like `pbcopy`, `caffeinate` and `say`, that are specific to the Mac.

## Why learn Terminal commands at all?

Because some jobs take many clicks and one typed line. Renaming a hundred files, finding every file that mentions a word, copying a folder while keeping hidden files, checking what’s eating disk space: each is a few clicks per item in Finder and one line in the shell. The catch is that the shell does exactly what you type, mistakes included, so it pays to know the handful of commands well rather than many of them badly.

## Which commands move you around?

| Command | What it does |
|---|---|
| `pwd` | Prints the folder you’re in |
| `ls` | Lists the folder; `ls -la` adds hidden files and details |
| `cd Documents` | Goes into a folder |
| `cd ..` | Goes up one folder |
| `cd ~` or `cd` | Goes to your home folder |
| `cd -` | Goes back to the previous folder |
| `clear` or Cmd+K | Clears the screen |

Tab completes file and folder names; when several match, the shell lists them.

## Which commands work with files?

| Command | What it does |
|---|---|
| `mkdir projects` | Makes a folder |
| `touch notes.txt` | Makes an empty file (or updates its date) |
| `cp a.txt b.txt` | Copies a file; `cp -R` for folders |
| `mv a.txt docs/` | Moves or renames |
| `rm a.txt` | Deletes, with no Trash and no undo |
| `cat file` | Prints a file |
| `less file` | Pages through a file; q quits |
| `du -sh *` | Shows the size of each item in the folder |
| `df -h` | Shows free space on each disk |

To see dotfiles in Finder as well, the [guide to showing hidden files](https://monok.io/blog/show-hidden-files-mac) has the shortcut.

## Which commands search?

- `grep -r "TODO" .` finds every line containing TODO under the current folder.
- `find . -name "*.pdf"` finds files by name pattern.
- `mdfind "invoice"` searches with Spotlight’s index, the same one Cmd+Space uses.
- `history | grep ssh` finds a command you ran before.
- `man ls` shows the manual for any command; q quits.

## Which commands are Mac only?

| Command | What it does |
|---|---|
| `open .` | Opens the current folder in Finder |
| `open file.pdf` | Opens a file in its default app |
| `open -a Preview file.png` | Opens it in a named app |
| `pbcopy < file.txt` | Copies a file’s text to the clipboard |
| `pbpaste > file.txt` | Writes the clipboard to a file |
| `caffeinate` | Keeps the Mac awake until you press Ctrl+C |
| `say "done"` | Speaks the text aloud |
| `mdfind` | Searches with Spotlight |
| `sw_vers` | Shows the macOS version |
| `softwareupdate -l` | Lists available system updates |

A handy pattern: `npm test; say done` tells you when a long command finishes.

## How do you stay safe with rm and sudo?

`rm` skips the Trash, so check the path before pressing Return, and be very careful with `rm -r`. `sudo` runs a command as the administrator; use it only when you know why a command needs it. When a command came from a web page, read it first. Pasting a line into a shell runs whatever it says.

## Where can you run these next to your browser?

Anywhere you have a shell. In Monok, a Mac browser with a native terminal, Ctrl+`splits a terminal pane under the page running your own login shell, and`>command` in an empty pane’s Magic Bar runs it once you press Return. No web page or JavaScript can reach that terminal. The [built-in terminal post](https://monok.io/blog/browser-with-built-in-terminal) covers it, the [tmux cheat sheet](https://monok.io/blog/tmux-cheat-sheet) covers splitting panes, and the [home page](https://monok.io/) has the tour.

**Try it:** [download Monok for Mac](https://monok.io/download), free while in preview, macOS 14 or later.

## FAQ

### How do I open Terminal on a Mac?

Press Cmd+Space, type Terminal and press Return. It is also in Applications › Utilities.

### What does `sudo` do?

It runs one command with administrator rights after asking for your password.

### How do I stop a running command?

Press Ctrl+C.

### Is Monok’s terminal a full shell?

Yes: your login shell with your rc files and tools. Get it on the [download page](https://monok.io/download).

Early preview · macOS

Monok is a small Mac browser with a native terminal and a file manager.

Magic Bar, tmux-style panes, your own shell and ad blocking built in. Free while in preview.

 [Go to the download](https://monok.io/download)

**About this article.** Written by Nemo, who is building Monok. Performance numbers here are v1 targets unless a post says they were measured, and on what. Spotted something wrong or out of date? [Tell us](mailto:support@monok.io).

More in Terminal

[Terminal](https://monok.io/blog/category/terminal) Oct 27, 2026 · 5 min

## [tmux Cheat Sheet: Sessions, Windows and Split Panes](https://monok.io/blog/tmux-cheat-sheet)

A tmux cheat sheet with the default keys for sessions, windows, split panes, copy mode and config, plus how the same pane habits work in Monok on a Mac.

[Guides](https://monok.io/blog/category/guides) Oct 29, 2026 · 4 min

## [Best Browser for Mac: How to Choose the Right One](https://monok.io/blog/best-browser-for-mac)

How to pick the best browser for Mac: engine, memory, ad blocking, extensions and sync compared for Safari, Chrome, Firefox and smaller browsers like Monok.

[Files](https://monok.io/blog/category/files) Oct 28, 2026 · 4 min

## [How to Show Hidden Files on Mac: Finder and Terminal](https://monok.io/blog/show-hidden-files-mac)

How to show hidden files on a Mac: the Finder shortcut Cmd+Shift+Period, the Terminal command that keeps them visible, and how to reach the Library folder.
