2013-11-13 23:07:00 +01:00
|
|
|
# WARNING ! netstat is deprecated. Look below.
|
|
|
|
|
2013-08-22 03:34:11 +02:00
|
|
|
# To view which users/processes are listening to which ports:
|
2013-08-11 21:37:11 +02:00
|
|
|
sudo netstat -lnptu
|
2013-09-01 22:04:17 +02:00
|
|
|
|
|
|
|
# To view routing table (use -n flag to disable DNS lookups):
|
|
|
|
netstat -r
|
2013-09-12 01:59:20 +02:00
|
|
|
|
|
|
|
# Which process is listening to port <port>
|
|
|
|
netstat -pln | grep <port> | awk '{print $NF}'
|
|
|
|
|
|
|
|
Example output: 1507/python
|
|
|
|
|
2013-10-09 00:16:31 +02:00
|
|
|
# Fast display of ipv4 tcp listening programs
|
|
|
|
sudo netstat -vtlnp --listening -4
|
2013-11-13 23:07:00 +01:00
|
|
|
|
|
|
|
# WARNING ! netstat is deprecated.
|
|
|
|
# Replace it by:
|
|
|
|
ss
|
|
|
|
|
|
|
|
# For netstat-r
|
|
|
|
ip route
|
|
|
|
|
|
|
|
# For netstat -i
|
|
|
|
ip -s link
|
|
|
|
|
|
|
|
# For netstat-g
|
|
|
|
ip maddr
|