Operating System - HP-UX
1847762 Members
3474 Online
104013 Solutions
New Discussion

Re: Command for open ports!

 
Mike_21
Frequent Advisor

Command for open ports!

I know you can loof in /etc/services, but is there a command that will list what ports are open, and listening?

Thanks
7 REPLIES 7
Santosh Nair_1
Honored Contributor

Re: Command for open ports!

You can do a netstat -na|grep LISTEN to find all the ports that are currently being used. But you'd have to get lsof to find out what program is using those ports...see the other recent thread for more details:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x1de9f715edc6d5118ff10090279cd0f9,00.html

-Santosh
Life is what's happening while you're busy making other plans
Patrick Wallek
Honored Contributor

Re: Command for open ports!

A couple of ways to do what you want I think.

First, have a look at the netstat command.

Second, install lsof.
http://hpux.cs.utah.edu and search on lsof.
Lou Zirko_1
Frequent Advisor

Re: Command for open ports!

Perhaps you are looking for the command:

netstat -a

If this is not what you need let us know.

Lou Zirko
UNIX Engr
Advisor

Re: Command for open ports!

netstat -an | grep LISTEN

Uday_S_Ankolekar
Honored Contributor

Re: Command for open ports!

Hi,

Install lsof. You can get it from any of HP-UX porting centere website ;
http://hpux.cs.utah.edu

GoodLuck

-USA..

Good Luck..
Mike_21
Frequent Advisor

Re: Command for open ports!

Do you know if there is a diagnostic I could use to determine if another process is trying to use port xxxx?
Lou Zirko_1
Frequent Advisor

Re: Command for open ports!

You can do

netstat -a | grep

or as others have suggested get and install lsof and use the the options that they spelled out for you.

Lou Zirko