Checking running servers with netstat


This post originally appeared on the Annexe.

A useful set of flags is the delightful “plunt”

# netstat -plunt

For example, on a PostgreSQL box with custom ports:

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address       Foreign Address         State       PID/Program name
tcp    0      0    *               LISTEN      1077/sshd       
tcp    0      0*               LISTEN      2288/postgres   
tcp6   0      0 :::22                   :::*                    LISTEN      1077/sshd       
tcp6   0      0 ::1:5432                :::*                    LISTEN      2288/postgres

Author bio and support


Ruben Schade is a technical writer and infrastructure architect in Sydney, Australia who refers to himself in the third person. Hi!

The site is powered by Hugo, FreeBSD, and OpenZFS on OrionVM, everyone’s favourite bespoke cloud infrastructure provider.

If you found this post helpful or entertaining, you can shout me a coffee or send a comment. Thanks ☺️.