Table of Contents
- Getting Started: Opening the Mac Terminal
- Navigation Commands: Move Around Your File System
- File and Folder Operations: Create, Copy, Move, Delete
- System and Process Commands
- Network and Productivity Commands
- Common Questions — Mac Terminal Commands for Beginners
- Conclusion: The 25 Terminal Commands That Change Everything
The Mac terminal is one of the most powerful tools on your computer — and most Mac users never open it. Learning mac terminal commands for beginners unlocks capabilities that no GUI can match: bulk file operations, remote server access, automation scripts, network diagnostics, and more. You don’t need to be a programmer to benefit. In this guide, you’ll get 25 essential macOS terminal commands grouped by category, each explained with what it does and a real example. Whether you’re a student, a developer just starting out, or simply a power user who wants more control over your Mac, these commands will transform how you work.

Getting Started: Opening the Mac Terminal
Before diving into commands, here’s how to open Terminal on Mac:
- Spotlight: Press
Cmd + Space, type “Terminal”, press Enter - Finder: Go to Applications → Utilities → Terminal
- Launchpad: Search for “Terminal” in the search bar
macOS uses zsh as the default shell since macOS Catalina (2019). The commands below work in both zsh and bash. For more beginner how-to tech guides, browse our full tutorial library.
Navigation Commands: Move Around Your File System

These are the commands you’ll use every single time you open Terminal. Master these first.
1. pwd — Print Working Directory
Shows your current location in the file system. Always a good first command when you’re disoriented.
pwd
# Output: /Users/yourname/Documents
2. ls — List Files and Folders
Lists everything in the current directory. Add flags to see more detail.
ls # Basic list
ls -la # Long format with hidden files and permissions
ls -lh # Human-readable file sizes
3. cd — Change Directory
Moves you to a different folder. The most-used command in the terminal.
cd Documents # Go into Documents folder
cd .. # Go up one level
cd ~ # Go to your home directory
cd / # Go to root directory
cd - # Go to previous directory
4. open — Open Files or Folders
Opens a file or folder in its default app. Unique to macOS.
open . # Open current folder in Finder
open file.pdf # Open a PDF in Preview
open -a Safari https://hubkub.com # Open URL in specific app
File and Folder Operations: Create, Copy, Move, Delete
These commands let you manage files without touching the mouse — faster once you know them.
5. mkdir — Make a New Directory
mkdir new-folder
mkdir -p projects/2026/january # Create nested directories at once
6. touch — Create a New Empty File
touch notes.txt
touch index.html style.css script.js # Create multiple files at once
7. cp — Copy Files or Folders
cp file.txt backup.txt # Copy file
cp -r folder/ folder-backup/ # Copy folder recursively
8. mv — Move or Rename Files
mv file.txt Documents/file.txt # Move file
mv old-name.txt new-name.txt # Rename file
9. rm — Remove Files (Caution: Permanent)
Unlike deleting in Finder, rm bypasses the Trash. There is no undo.
rm file.txt # Delete a file
rm -rf folder/ # Delete a folder and all contents (use with extreme caution)
10. cat — Display File Contents
cat file.txt # Print file contents to terminal
cat file1.txt file2.txt # Concatenate and display multiple files
11. grep — Search Inside Files
One of the most powerful beginner commands. Finds text patterns in files.
grep "error" logfile.txt # Find lines containing "error"
grep -r "TODO" ~/projects/ # Search recursively in a folder
grep -i "apple" fruits.txt # Case-insensitive search
12. find — Search for Files by Name
find . -name "*.pdf" # Find all PDFs in current folder
find ~/Downloads -name "*.zip" -mtime -7 # ZIPs modified in last 7 days
System and Process Commands
Monitor your Mac’s health, manage processes, and control system settings from the command line. For power users managing multiple systems, check out our DevOps and IT Ops guides for advanced techniques.
13. top — Real-Time Process Monitor
Shows live CPU, memory, and process usage. Press q to quit.
top
14. ps — List Running Processes
ps aux # List all running processes with details
ps aux | grep "Safari" # Find specific app's process
15. kill — Stop a Process
kill 1234 # Gracefully stop process with PID 1234
kill -9 1234 # Force kill (use if regular kill doesn't work)
16. df — Check Disk Space
df -h # Show disk usage in human-readable format
17. du — Check Folder Size
du -sh ~/Downloads # Size of Downloads folder
du -sh ~/Desktop/* # Size of each item on Desktop
18. history — View Command History
history # Show last 500 commands
history | grep "git" # Filter history for git commands
19. sudo — Run as Administrator
Prefix any command with sudo to run it with admin privileges. You’ll be prompted for your Mac password.
sudo nano /etc/hosts # Edit hosts file (requires admin)
Network and Productivity Commands
20. ping — Test Network Connectivity
ping google.com # Test if a host is reachable (Ctrl+C to stop)
ping -c 4 google.com # Send exactly 4 pings
21. curl — Fetch URLs from the Terminal
curl https://example.com # Fetch a webpage
curl -O https://example.com/file.zip # Download a file
22. ssh — Connect to Remote Servers
ssh [email protected] # Connect to a local server
ssh [email protected] -p 2222 # Connect on a custom port
23. brew — The Mac Package Manager (Homebrew)
Install Homebrew first from brew.sh. Once installed, you can install almost any developer tool with one command.
brew install git # Install git
brew install node # Install Node.js
brew update && brew upgrade # Update all installed packages
24. pbcopy and pbpaste — Clipboard in the Terminal
Mac-specific commands that connect your terminal output to the clipboard.
cat file.txt | pbcopy # Copy file contents to clipboard
pbpaste > new-file.txt # Paste clipboard contents to a file
pwd | pbcopy # Copy current path to clipboard
25. defaults — Read and Write macOS System Settings
Access hidden macOS preferences not available in System Settings.
# Show hidden files in Finder
defaults write com.apple.finder AppleShowAllFiles true
killall Finder
# Show full path in Finder title bar
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
killall Finder
Common Questions — Mac Terminal Commands for Beginners
Q: Can I accidentally break my Mac using terminal commands?
A: Yes, some commands can cause damage if used incorrectly — particularly rm -rf, sudo commands, and anything modifying system files. The golden rule: never run commands you don’t understand, especially with sudo. For beginners, stick to the 25 commands in this guide and you’ll be completely safe. Always double-check paths before running rm.
Q: What is the difference between Terminal and iTerm2?
A: Terminal is the built-in macOS app — perfectly capable for most tasks. iTerm2 is a popular free alternative with more features: split panes, better autocomplete, search history highlighting, and extensive customization. Many developers prefer iTerm2 for daily use, but Terminal is fine for learning. You can download iTerm2 free from iterm2.com.
Q: How do I cancel a running command in the Mac terminal?
A: Press Ctrl + C to interrupt most running commands. If a command is stuck, try Ctrl + Z to suspend it (then type kill %1 to terminate). Press q to quit interactive commands like top or man. Press Ctrl + D to close the terminal session.
Q: How do I run multiple commands in one line?
A: Use && to chain commands that only run if the previous succeeded: mkdir new-folder && cd new-folder. Use ; to run commands regardless of success: command1; command2. Use || to run the second command only if the first fails. These operators are fundamental to shell scripting.
Conclusion: The 25 Terminal Commands That Change Everything
These 25 mac terminal commands for beginners cover navigation, file management, system monitoring, networking, and productivity. Three key takeaways to remember:
- Start with the basics:
pwd,ls,cd,mkdir, andcpwill handle 80% of your daily terminal needs. Learn these cold before moving on. - Use
manto learn more: Typeman COMMAND(e.g.,man ls) to read the full manual for any command directly in your terminal. - Practice daily: The terminal rewards consistent use. Replace one Finder action per day with a terminal command and you’ll be fluent within a month.
Once you’re comfortable with these fundamentals, explore shell scripting to automate repetitive tasks, and check out our how-to guides for more developer productivity tips including Git workflows, SSH configuration, and automation scripts.
Last Updated: April 13, 2026








