Skip to content
File Operations:
- How to list files and directories in Mac Terminal
- How to change directory in Mac Terminal
- How to create a new file in Mac Terminal
- How to create a new directory in Mac Terminal
- How to copy files and directories (
cp
)
- How to move or rename files (
mv
)
- How to delete files (
rm
)
- How to delete directories (
rm -r
)
- How to display file contents (
cat
, less
, more
)
- How to find large files (
du -sh
)
- How to open files or apps from Terminal (
open
)
- How to change file permissions (
chmod
)
- How to change file ownership (
chown
)
- How to create a symbolic link (
ln -s
)
Network Operations:
- How to check your IP address in Mac Terminal
- How to ping a server (
ping
)
- How to check network connections in Mac Terminal
- How to traceroute a network (
traceroute
)
- How to test internet speed using curl in Mac Terminal
- How to SSH into a remote server (
ssh
)
- How to download a file from a URL (
curl
or wget
)
- How to check active network interfaces (
ifconfig
)
- How to flush DNS cache (
sudo killall -HUP mDNSResponder
)
- How to see open ports (
lsof -i
or netstat -an
)
- How to stop/start Wi-Fi from Mac Terminal
- How to test internet connection using ping in Mac Terminal
Searching and File Management:
- How to find a file by name (
find
)
- How to search for text in files (
grep
)
- How to search recursively for text in files (
grep -r
)
- How to find files by size in Mac Terminal
- How to search for a specific pattern in files (
grep "pattern"
)
- How to locate files on your system (
locate
)
- How to view recently modified files (
find . -mtime
)
System Operations:
- How to view system information (
system_profiler
)
- How to view CPU usage in Mac Terminal
- How to view memory usage (
vm_stat
)
- How to list running processes (
ps aux
)
- How to kill a running process (
kill
or killall
)
- How to clear Terminal history in Mac Terminal
- How to update Homebrew (
brew update
)
- How to install a package using Homebrew (
brew install
)
- How to open a file with a specific application (
open -a [AppName]
)
Conversions and Encoding:
- How to convert a file from one format to another (e.g.,
ffmpeg
)
- How to convert text file line endings (
dos2unix
, unix2dos
)
- How to encode/decode Base64 strings (
base64
)
- How to convert an image format (e.g.,
sips
for image conversion)
- How to change file encoding (
iconv
)
Package Management:
- How to install Homebrew on Mac (
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)")
- How to install a package using Homebrew (
brew install [package]
)
- How to uninstall a Homebrew package (
brew uninstall [package]
)
- How to search for Homebrew packages (
brew search [name]
)
File Compression and Extraction:
- How to compress files to a .zip archive in Mac Terminal
- How to extract .zip files in Mac Terminal
- How to create a
.tar.gz
file (tar -czf
)
- How to extract a
.tar.gz
file (tar -xzf
)
- How to create a
.rar
archive (rar
)
- How to extract
.rar
files (unrar
)
Disk and System Management:
- How to check disk space in Mac Terminal
- How to check directory size in Mac Terminal
- How to format a USB drive in Mac Terminal
- How to mount and unmount drives (
diskutil mount/unmount
)
- How to repair disk permissions (
diskutil repairPermissions
)
- How to create a bootable USB drive (
dd
or diskutil
)
- How to show hidden files
- How to hide files using Mac Terminal
- How to enable or disable SIP (System Integrity Protection) on macOS
Shell and Scripting:
- How to create and run a bash script
- How to set environment variables (
export VAR=value
)
- How to view environment variables (
printenv
)
- How to create an alias (
alias
)
- How to make a script executable (
chmod +x script.sh
)
- How to run Python scripts from Terminal (
python3 script.py
)
- How to schedule tasks with
cron
- How to use the
echo
command to display text
- How to redirect output to a file (
>
, >>
)
Terminal Customization:
- How to change the Terminal prompt (
PS1
)
- How to change the default shell (e.g., from
bash
to zsh
)
- How to customize
.bash_profile
or .zshrc
- How to add custom colors to Terminal
- How to change Terminal themes
Network Troubleshooting:
- How to flush DNS cache (
sudo dscacheutil -flushcache
)
- How to view network interfaces (
ifconfig
)
- How to view current Wi-Fi connection info (
networksetup -getairportnetwork en0
)
- How to reset network settings using Terminal
- How to scan for available Wi-Fi networks (
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s
)
Miscellaneous Operations:
- How to find the macOS version (
sw_vers
)
- How to list installed applications (
ls /Applications/
)
- How to change the system time and date (
date
)
- How to force quit an application using Terminal
- How to show all active network connections (
lsof -i
)
- How to start a Python web server (
python3 -m http.server
)
- How to run background processes using
nohup
- How to empty the trash from Terminal in Mac
- How to create a new user from Terminal
- How to restart or shut down your Mac from Terminal
- How to take a screenshot using Terminal (
screencapture
)
- How to use the Terminal as a calculator (
bc
)