netstat
has some very neat features we could make use of more often! Here is 5.
Note: examples here may not apply to BSD based systems
1. The classic: list local listening TCP/UDP ports and their process:
$ sudo netstat -tulpn
2. Get a tail -f
behaviour with:
$ sudo netstat -c
3. Show network transactions:
# including RX/TX and MTU
$ sudo netstat -i
4. Display the routing table:
$ sudo netstat -r
5. Show statistics by protocol:
$ sudo netstat -s