Operating System - HP-UX
1827452 Members
4096 Online
109965 Solutions
New Discussion

Re: Ports in listening mode

 
Becke
Super Advisor

Ports in listening mode


Guys

What's the easiest way to identify if a port on our unix box is in listening mode or not ?

I'm trying to identify if tsm ports ie 1500 to 1516 are in listening or not ?

5 REPLIES 5
Becke
Super Advisor

Re: Ports in listening mode


By the way im trying to use netstat -an|grep 1516 but nothing displays, and more importanly which bits tells u if it's listening ?
Kapil Jha
Honored Contributor

Re: Ports in listening mode

you can try

#telnet IP 1516

You can see if its listening else connection refused.

BR,
Kapil+
I am in this small bowl, I wane see the real world......
Jim Walls
Trusted Contributor

Re: Ports in listening mode


netstat -an|grep LISTEN|grep \.15..

(Note the two training "." characters)

Run this on the server where you expect the process to be listening. If you get nothing then there is no process currently listening on a port in that range.

If you have lsof you can run:

lsof -i:1500-1516

Becke
Super Advisor

Re: Ports in listening mode


Sory for the late reply as I was away in remote location.

Thanks guys, appreciate your prompt help.

I knew telnet to port one but I wasn't quite
sure about netstat one which Jim has clarified.

Many Thanks again..
Viktor Balogh
Honored Contributor

Re: Ports in listening mode

Hi,

If you are curious, what process is listening on that port, you can use lsof to check it:

# lsof -i :1500

lsof is an extra tool, you should install it separately. You can download the HP-UX version of it from the porting center:

http://hpux.ewi.tudelft.nl/

Only a short supplement: if you would be on linux, there's no need for "grep -i listen", there is a -l switch for netstat...

Regards,
Viktor
****
Unix operates with beer.