Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do we find the port number

Status
Not open for further replies.

bhawani123

IS-IT--Management
Nov 1, 2000
152
IN
Hello Guys,

Can you help me out about my query?How do we find out the port number and Activity running
on that port number?

Thanks in advance

Thanks
Ajay Lohani
 
I am not sure what you are looking for but you can find the port number for a service in the file /etc/services. Too bad I.T. is not cash business

Luc Foata
Unix sysadmin, Oracle DBA
 
Hi,
U can use these two commands:-
#grep <service name> /etc/services (This shows the port no.)
#netstat -a|grep <service name> (If the port is listening or active)

I hope this helps......
 
Thanks NavinB,

With help of your Suggested solution I got a partial Solution from your second command.can you clear how could I check numbers of services running on that perticular port?
This Port is not defined in /etc/services file and I Added this port for perticular Service.
Now I want to see how many daemon ruuning on that port?

Thanks For your valuable suggestion.

Thanks
Ajay
 
Hello kporeddy,

There is no command and Manual page of lsof.

Thanks,
Ajay Lohani
 
lsof is not native to the OS. It is a utility that shows open files, and who is accessing them.
If your utility/daemon is running,

# netstat -a | grep (port_number)

will show you the active connections, or a listening port.

crowe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top