This is a small collection of useful ss (written by Alexey Kuznetsov of the Russian Nuclear Research Institute) syntax examples that go beyond the basics covered by other sources. Here’s one I use often: it shows established connections to destinations beyond the localhost and its local subnet:

Sample output:

A similar example showing process name, PID, and file descriptor. This can be useful if you need to strace the PID or just kill it.

Another variation of the above showing output of ps -ef for each PID:

You can use the PID information in conjunction with nethogs and iftop to see who’s eating up your bandwidth.

Leave A Reply

Please enter your comment!
Please enter your name here