[BBLISA] task and port number?

David Allan dave at dpallan.com
Tue Dec 18 15:51:56 EST 2007


I'd just use lsof -i :<port>

[root at thror ~]# lsof -i :80
COMMAND   PID   USER   FD   TYPE DEVICE SIZE NODE NAME
gij      2640 tomcat  153u  IPv4 151687       TCP 
192.34.24.5:35075->foo.bar.baz.com:http (CLOSE_WAIT)
httpd   24876   root    4u  IPv6 148563       TCP *:http (LISTEN)
httpd   24878 apache    4u  IPv6 148563       TCP *:http (LISTEN)
httpd   24879 apache    4u  IPv6 148563       TCP *:http (LISTEN)
httpd   24880 apache    4u  IPv6 148563       TCP *:http (LISTEN)
httpd   24881 apache    4u  IPv6 148563       TCP *:http (LISTEN)
httpd   24882 apache    4u  IPv6 148563       TCP *:http (LISTEN)
httpd   24883 apache    4u  IPv6 148563       TCP *:http (LISTEN)
httpd   24884 apache    4u  IPv6 148563       TCP *:http (LISTEN)
httpd   24885 apache    4u  IPv6 148563       TCP *:http (LISTEN)
[root at thror ~]#



On Tue, 18 Dec 2007, mike ledoux wrote:

> On Tue, Dec 18, 2007 at 03:40:34PM -0500, Scott Ehrlich wrote:
>> netstat -a will show apps and their PIDs, then later what ports are open,
>> but no direct port <-> app mapping.
>
> Add '-p' to that netstat command, that should show you what PID is
> associated with each connection or listening port.  You'll need to
> be root for the output to be very interesting.
>
> -- 
> mwl at alumni.unh.edu                 OpenPGP KeyID 0x57C3430B
> Holder of Past Knowledge           CS, O-
> "Happiness is the absence of the striving for happiness."  Chuang-Tzu
>
> _______________________________________________
> bblisa mailing list
> bblisa at bblisa.org
> http://www.bblisa.org/mailman/listinfo/bblisa
>




More information about the bblisa mailing list