Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A command I often use for a nice overview of running stuff:

  $ netstat --numeric-ports -elp46 | sort

    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       User       Inode       PID/Program name
    tcp        0      0 0.0.0.0:22223           0.0.0.0:*               LISTEN      root       12159       3370/sshd       
    tcp        0      0 0.0.0.0:3000            0.0.0.0:*               LISTEN      root       781140      4940/nginx -g daemo
    tcp        0      0 0.0.0.0:4000            0.0.0.0:*               LISTEN      postgres   780857      4916/postgrest  
    tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      root       13126       3537/master     
    tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN      postgres   12526       3406/postgres   
    tcp6       0      0 ::1:5432                :::*                    LISTEN      postgres   12525       3406/postgres   
    tcp6       0      0 :::22223                :::*                    LISTEN      root       12168       3370/sshd       
    udp        0      0 0.0.0.0:123             0.0.0.0:*                           root       12479       3400/ntpd       
    udp        0      0 127.0.0.1:123           0.0.0.0:*                           root       12485       3400/ntpd       
    udp6       0      0 ::1:123                 :::*                                root       12487       3400/ntpd       
    udp6       0      0 :::123                  :::*                                root       12480       3400/ntpd


Apparently netstat is one of the commands being depreciated on Linux, to be replaced by ss.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: