1753765 Members
6071 Online
108799 Solutions
New Discussion юеВ

Re: Services, ports.

 
Caronte
New Member

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.
3 REPLIES 3
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:

http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1410504

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

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

Re: Services, ports.

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

cat /etc/services will show its content

Hope this helps
/home/BIH/Sarajevo
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