Kudithipudi.Org

January 26, 2011

HOW TO : Find out which network port a program is using in linux

Filed under: HOWTO,Linux,Technology — Vinay @ 1:46 pm

Quick way to figure out, which ports a particular program is using in linux

 netstat -plan | grep -i PROGRAM_NAME 

Example : Check which ports SSH is listening on


samurai@samurai:~$ sudo /bin/netstat -plan | grep sshd
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      5257/sshd
tcp        0     52 123.123.123.123:22      124.124.124.124:32846     ESTABLISHED 3551/sshd: samurai
tcp6       0      0 :::22                   :::*                    LISTEN      5257/sshd
unix  3      [ ]         STREAM     CONNECTED     5893     3551/sshd: samurai
unix  2      [ ]         DGRAM                    5849     3551/sshd: samurai

1 Comment »

  1. hello, outstanding blog page, and a fairly good understand! just one for my bookmarking.

    Comment by Cassey — January 27, 2011 @ 2:01 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress