1847697 Members
6452 Online
110265 Solutions
New Discussion

ports checking

 
Sanjiv Sharma_1
Honored Contributor

ports checking

Hi All,

How can I check which all ports are in use and which all ports are not?

Also is there any other file apart from the /etc/services.

In my /etc/services:
# The X10_LI server for each display listens on ports 5800 + display number.
# The X10_MI server for each display listens on ports 5900 + display number.
# The X11 server for each display listens on ports 6000 + display number.
# The X11 font server listens on port 7000.
# Do NOT associate other services with these ports.
# Refer to the X documentation for details.

It has been mentioned that "X11 font server listens on port 7000."

But there is no entry for this port in the /etc/services. How can I check whether this port is in use? If it being used how can I disable it?

Thanks,
Raje.
Everything is possible
5 REPLIES 5
Animesh Chakraborty
Honored Contributor

Re: ports checking

Hi,
#netstat -a
to see which ports are in use
or you can down load lsof which gives much clear picture.
Did you take a backup?
Patrick Chim
Trusted Contributor

Re: ports checking

Hi,

It's good to use 'lsof' to check the port status and you can download in

http://hpux.cs.utah.edu/

If you are running HP-UX 11i, you have to download the source and compile by yourself.

e.g. lsof -i tcp:7000
and it will give you the process id that holding this port.

Regards,
Patrick
Sanjiv Sharma_1
Honored Contributor

Re: ports checking

Hi Patrick/Animish,

I have HP-UX 11i and have downloaded lsof 4.64 for 11.00,11.20 and the tar file from http://hpux.connect.org.uk/hppd/hpux/Sysadmin/lsof-4.64/

I am unable to use the lsof os 11.00( version mismatch 32 bit and 64 bit) nor of 11.20(Execute permission denied).

As advised I think I have to compile from the source code in the tar file.

Can you give me stepwise the command to extract and compile lsof?

Thanks,
Raje.
Everything is possible
Patrick Chim
Trusted Contributor

Re: ports checking

Hi,

After you extract the tar file, just type './Configure hpux' and 'make' will do all the steps for you.

You can read the HPUX.install or README for more details.

Regards,
Patrick
Michael Tully
Honored Contributor

Re: ports checking