15 Feb 2026
Frequently Used Terminal Commands
A practical reference list of commonly used macOS terminal commands for daily development and system management.
macos
terminal
cli
unix
development
macOS is built on Unix, which means powerful terminal commands are available for file management, networking, system monitoring, and development tasks.
Below is a structured list of frequently used macOS commands.
To Stop Terminal Process
Ctrl + Cโ Stop current processCtrl + Zโ Suspend processCmd + .โ Interrupt process (alternative to Ctrl + C)- โ + Shift + . โ Force quit terminal app by modifying the .zshrc to some another name (use with caution)
File & Directory Management
pwdโ Print current directorylsโ List filesls -laโ List all files (including hidden)cd <directory>โ Change directorycd ..โ Move up one directorymkdir <name>โ Create directoryrmdir <name>โ Remove empty directoryrm <file>โ Remove filerm -rf <directory>โ Force remove directorycp <src> <dest>โ Copy filemv <src> <dest>โ Move or rename filetouch <file>โ Create empty fileopen .โ Open current folder in Finder
File Viewing & Editing
cat <file>โ Display file contentless <file>โ View file page by pagehead <file>โ Show first 10 linestail <file>โ Show last 10 linestail -f <file>โ Live file monitoringnano <file>โ Open file in Nano editorvim <file>โ Open file in Vimcode <file>โ Open file in VS Code (if installed)
System Information
whoamiโ Current userhostnameโ System hostnameuname -aโ System informationsw_versโ macOS versiondateโ Current date & timeuptimeโ System running time
Disk & Storage
df -hโ Disk free spacedf -h /โ Main drive spacedu -sh .โ Current folder sizedu -sh <folder>โ Specific folder size
Process Management
topโ Live system monitorps auxโ List running processeskill <pid>โ Kill processkill -9 <pid>โ Force kill process
Network Commands
ping <host>โ Check connectivityifconfigโ Network configurationnetstat -anโ Network statisticscurl <url>โ Fetch URL contentwget <url>โ Download file (if installed)
Package Management (Homebrew)
brew updateโ Update formulaebrew upgradeโ Upgrade packagesbrew install <pkg>โ Install packagebrew uninstall <pkg>โ Remove packagebrew listโ List installed packages
Git Commands (Development)
git clone <repo>โ Clone repositorygit statusโ Check statusgit add .โ Stage changesgit commit -m "message"โ Commit changesgit pushโ Push to remotegit pullโ Pull updates
Permission & Ownership
chmod +x <file>โ Make file executablechmod 755 <file>โ Set permissionchown user:group <file>โ Change ownership
Environment & Shell
echo $PATHโ Show PATH variableexport VAR=valueโ Set environment variablesource ~/.zshrcโ Reload shell configclearโ Clear terminal (Shortcut: `Cmd + K`)
To find files larger than a specific size in macOS, use the find command with the -size option.
Find Files Larger Than 2GB (Entire System)
sudo find / -type f -size +2G 2>/dev/null
- sudo โ Required to access all directories
- / โ Search from root
- -type f โ Only files (For directories, use -type d)
- -size +2G โ Greater than 2GB
- 2>/dev/null โ Hide permission errors
Find Files Larger Than 3GB
sudo find / -type f -size +3G 2>/dev/null
Search Only Inside Home Directory (Safer & Faster)
find ~ -type f -size +2G
Show File Size Along With Name (Sorted by Size)
find ~ -type f -size +2G -exec ls -lh {} ; | sort -k5 -h
Find Top 20 Largest Files (Alternative Method)
sudo du -ah / 2>/dev/null | sort -rh | head -20
Size Units in find
- k โ Kilobytes
- M โ Megabytes
- G โ Gigabytes
Examples:
-size +500M -size +1G -size +5G
Discussion