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