macOS Terminal Commands
50 essential macOS Terminal commands
lsList 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
ifconfigDisplays network interface configuration
ifconfig en0 down / ifconfig en0 upDisables/enables network interface
sudo ipconfig set en0 DHCPForces 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 -aViews local ARP table
route -n get <host>Displays route info to a specific host
networksetup -listallhardwareportsLists all network ports & interfaces
topDisplay and update sorted information about processes
ps auxDisplay information about running processes
kill [PID]Terminate a process
sudo [command]Execute a command with superuser privileges