macOS Terminal Advanced

Advanced macOS Terminal commands and utilities.

Search & Find

Find files
find . -name *.txt

Search in files (grep)
grep search file.txt
grep -r search directory

Spotlight search
mdfind search term

Process Management

List processes
ps aux
top

Kill process
kill PID
killall ProcessName

Background process
command &

Jobs management
jobs
fg %1
bg %1

Disk & Storage

Disk usage
df -h

Directory size
du -sh folder

List disk volumes
diskutil list

Eject disk
diskutil eject /dev/disk2

Networking

Network configuration
ifconfig

Ping host
ping google.com

Download file
curl -O url

Flush DNS cache
sudo dscacheutil -flushcache