Try netstat
with additional args:
sudo netstat -wtpeav
The sudo
is there to make sure you run it as root, otherwise it won't show you everything.
The options are:
-w, --raw
Show raw sockets.
-t, --tcp
Show TCP protocol sockets.
-p, --program
Show the PID and name of the program to which each socket
belongs.
-e, --extend
Display additional information. Use this option twice for
maximum detail.
-a, --all
Show both listening and non-listening sockets. With the
--interfaces option, show interfaces that are not up
--verbose , -v
Tell the user what is going on by being verbose. Especially
print some useful informa‐ tion about unconfigured address
families.
Also, the columns at the end of /proc/net/tcp
are documented in the kernel source tree in Documentation/networking/proc_net_tcp.txt. The end fields are:
1000 0 54165785 4 cd1e6040 25 4 27 3 -1
| | | | | | | | | |--> slow start size threshold,
| | | | | | | | | or -1 if the threshold
| | | | | | | | | is >= 0xFFFF
| | | | | | | | |----> sending congestion window
| | | | | | | |-------> (ack.quick<<1)|ack.pingpong
| | | | | | |---------> Predicted tick of soft clock
| | | | | | (delayed ACK control data)
| | | | | |------------> retransmit timeout
| | | | |------------------> location of socket in memory
| | | |-----------------------> socket reference count
| | |-----------------------------> inode
| |----------------------------------> unanswered 0-window probes
|---------------------------------------------> uid