cheat/cheatsheets/netstat

12 lines
278 B
Plaintext
Raw Normal View History

# To view which users/processes are listening to which ports:
sudo netstat -lnptu
2013-09-01 22:04:17 +02:00
# To view routing table (use -n flag to disable DNS lookups):
netstat -r
# Which process is listening to port <port>
netstat -pln | grep <port> | awk '{print $NF}'
Example output: 1507/python