A quick reference guide for essential macOS terminal commands, including built-in utilities and common shell operations.

CommandDescription
pwdPrint Working Directory
ls -laList all files with detailed info
cd <dir>Change directory
mkdir <name>Create a new directory
touch <file>Create an empty file
cp -r <src> <dest>Copy files/folders recursively
mv <src> <dest>Move or rename files/folders
rm -rf <path>Force remove files/folders (use with caution!)

macOS Specific Commands

CommandDescription
open <path>Open a file, directory, or URL with the default app
open .Open the current directory in Finder
pbcopy < fileCopy file content to clipboard
pbpaste > filePaste clipboard content to a file
sw_versShow macOS version information
system_profilerDetailed system hardware/software information
diskutil listList all disks and partitions
mdfind <query>Search files using Spotlight from the terminal
caffeinatePrevent macOS from sleeping
screencapture -cTake a screenshot to the clipboard

Permissions and Ownership

CommandDescription
chmod 755 <file>Change file permissions
chown <user>:<group> <file>Change file owner and group
sudo <command>Execute a command with superuser privileges

Process Management

CommandDescription
topMonitor real-time system processes
ps auxList all running processes
kill <PID>Terminate a process by ID
killall <name>Terminate all processes with a specific name

Network Utilities

CommandDescription
ping <host>Check network connectivity
curl -O <url>Download a file via CLI
ifconfigView network interface configuration
ipconfig getifaddr en0Get local IP address for Wi-Fi
dig <domain>DNS lookup utility

(y) Return to Notes | (y) Return to CLI & Tools | (y) Return to Home