Mac Terminal Commands Cheat Sheet



Integrated terminal ⌃` Show integrated terminal ⌃⇧` Create new terminal ⌘C Copy selection ⌘↑ / ↓ Scroll up/down / PgDn Scroll page up/down Home / End Scroll to top/bottom Other operating systems’ keyboard shortcuts and additional unassigned shortcuts available at aka.ms/vscodekeybindings Keyboard shortcuts for macOS. These basic Terminal commands are often overlooked, though are useful for Mac users trying to obtain information about a system they may not be familiar with quickly and efficiently. The commands you run on the Terminal will execute in the current file location. To change the file location, you will use the Terminal command introduced below. Mac Terminal Commands List. There are tons of commands that you can make use of.

Mac Terminal Commands Cheat Sheet

ipconfig

  1. get ip address

  2. get subnet mask

  3. get dns server

  4. get info about how en0 got its dhcp on

ifconfig

  1. get network info

  2. set ip address and netmask

  3. renew dhcp leases

networksetup

  1. get a list of location on the computer

  2. get active location

  3. config manual static ip address

  4. config dns server

  5. get dns server

firewall

  1. stop the application layer firewall

  2. start the application layer firewall

  3. allow an app to communicate outside through the application layer firewall

route

  1. routing table

  2. add a route

  3. delete a route

netstat

  1. view info on all sockets

  2. network info for ipv6

  3. per protocol network statistics

  4. statistics for a specific network protocol

  5. statistics for network interfaces

  6. view network info as it happens

ping

  1. put a delay in pings

  2. ping hostname 5 times and then stop

  3. flood ping the host

  4. set packet size during ping

  5. customize source ip during ping

Mac Os Terminal Commands Cheat Sheet

trace

  1. trace the path packets go through

  2. without looking up names

  3. in debug mode

nc

Mac Terminal Commands Cheat Sheet Pdf

  1. establish a network connection

  2. establish a network connection over port 2195

  3. establish a network connection only allowing ipv4

  4. setup a network listener on port 2196 for testing

Mac

tcpdump

Os X Terminal Commands

  1. capture some packets

  2. capture all packets

  3. capture packets for port

  4. capture all packets for a given port going to destination 192.168.1.160

  5. capture packets as above but dump to a pcap file

  6. read tcpdump (cap) files and make them human readable

Windows terminal command

other

  1. flush the dns cache

  2. clear arp cache

  3. what binaries have what ports and in what states are those ports

  4. make an alias for looking at what has a listener open, called ports

  5. edit hosts file

Apple Commands Cheat Sheet

references