macOS Terminal Commands
50 essential macOS Terminal commands
ls

List files and directories

cd [directory]

Change directory

mkdir [name]

Create a new directory

rm [file]

Remove a file

cp [source] [destination]

Copy files

mv [source] [destination]

Move files

ifconfig

Displays network interface configuration

ifconfig en0 down / ifconfig en0 up

Disables/enables network interface

sudo ipconfig set en0 DHCP

Forces DHCP on an interface

ping <host>

Tests network connectivity

traceroute <host>

Traces the route to a host

nslookup <domain>

DNS lookup utility

dig <domain>

Advanced DNS queries

arp -a

Views local ARP table

route -n get <host>

Displays route info to a specific host

networksetup -listallhardwareports

Lists all network ports & interfaces

top

Display and update sorted information about processes

ps aux

Display information about running processes

kill [PID]

Terminate a process

sudo [command]

Execute a command with superuser privileges