Inspect network connections with netstat

List network connections, open ports and the programs running behind those ports with netstat.

Open a terminal and type:

netstat -ape

-a, –all, –listening display all sockets (default: connected)
-p, –programs display PID/Program name for sockets
-e, –extend display other/more information

Output:

Proto Recv-Q Send-Q Local Address           Foreign Address         State       User       Inode       PID/Program name
tcp        0      0 localhost:50505         *:*                     LISTEN      root       30762       -               
tcp        0      0 localhost:7337          *:*                     LISTEN      postgres   16339       -               
tcp        0      0 localhost:mysql         *:*                     LISTEN      mysql      10820       -               
tcp        0      0 *:3790                  *:*                     LISTEN      root       21804       -               
tcp        0      0 *:http                  *:*                     LISTEN      root       9607        -               
tcp        0      0 *:domain                *:*                     LISTEN      root       12045       -               
tcp        0      0 localhost:8118          *:*                     LISTEN      privoxy    12119       -               
tcp        0      0 localhost:ipp           *:*                     LISTEN      root       9772        -               
tcp        0      0 localhost:3001          *:*                     LISTEN      daemon     33936       -               
..
..
%d bloggers like this: