From: xzen on
how can i get which port is used by which process?
same as netstat
From: Bit Twister on
On Sun, 15 Jun 2008 05:59:27 -0700 (PDT), xzen wrote:
> how can i get which port is used by which process?
> same as netstat

man netstat

Putting which port is used by which process netstat
in the first box at http://groups.google.com/advanced_search
and asterisk linux asterisk in the news group box we find

Results 1 - 10 of about 3,420 for which port is used by which process
netstat group:*linux*
From: David Schwartz on
On Jun 15, 5:59 am, xzen <tianshizhil...(a)gmail.com> wrote:
> how can i get which port is used by which process?
> same as netstat

Run, as root:
netstat -a --program

DS
From: Artur Kaminski on
On Jun 18, 11:44 pm, David Schwartz <dav...(a)webmaster.com> wrote:
> On Jun 15, 5:59 am, xzen <tianshizhil...(a)gmail.com> wrote:
>
> > how can i get which port is used by which process?
> > same as netstat
>
> Run, as root:
> netstat -a --program
>

I have a short cut for all purposes (except routing table):

netstat -tapln

In effect I forgot which option is for what function :-)


Regards
Artur
From: Rohit on
On Jun 15, 5:59 pm, xzen <tianshizhil...(a)gmail.com> wrote:
> how can i get which port is used by which process?
> same as netstat

If you mean from your program,
"strace -o trace netstat" would tell you it does and do that.
In case you are lazy to run that command i reads files like
/proc/net/tcp, /proc/net/udp etc.

-- Rohit