Showing results for 
Search instead for 
Did you mean: 

Services, ports.

Occasional Visitor

Services, ports.

How can i know the port and service for applications on the system.

i know netstat command but i do not know how i can get the service and/or port.

thanks a lot.
Steven Schweda
Honored Contributor

Re: Services, ports.

I can't say that I understand what you would
really like to know, but for a brief
discussion of another, similarly unclear
request, see:

(But ignore the misleading references there
to "reservation" and "reserve".)

Is there some actual problem which you wish
to solve?
Frequent Advisor

Re: Services, ports.

known services on linux ( and windows as well ) are decribed in file

cat /etc/services will show its content

Hope this helps
Ralph Grothe
Honored Contributor

Re: Services, ports.

If it's the already running service that you would like to identify then as root you can execute

# netstat -tlnp

for listening tcp sockets with the pid/program that has that socket open printed in the last column (note, the -p option for GNU/netstat only works as root).
Likewise, for udp ports run

# netstat -ulnp

Of course,

# lsof -nPi | grep LISTEN

does also work.

Madness, thy name is system administration