Finding Process Info Associated to a Given Port in HP-UX
7,599
Follow these steps:
Find the PID (process ID) of the process using the port (e.g. 8080):
lsof -i tcp:8080
This will return: something like this:
java 1829 154 101u IPv4 0xd6cc04c0 0t0 TCP *:8080 (LISTEN)
The second column contains the PID we're after.
Find info about the process with a given PID (e.g 1829):
ps -f -p 1829
This will show, among other things, the path to the program of the process we're after:
usr1 1829 20693 0 11:13:13 ? 1:37 /d03/app/jvm/hp142/jre/bin/PA_RISC2.0/java -ms512M
Related videos on Youtube
Author by
Juanal
Updated on September 18, 2022Comments
-
Juanal over 1 year
I need to find information for a process that's using a given port number, such as 8080. More specifically, I'm interested in finding out the full path of the program.
How can I do that in HP-UX?
-
Admin over 8 yearsYou can get LSOF for hpux from here: h20392.www2.hp.com/portal/swdepot/… or hpux.connect.org.uk/hppd/hpux/Sysadmin/lsof-4.89
-
Admin over 8 yearsDoesn't work on HPUX: # netstat -nlp netstat: illegal option -- l
-
Kaiden Prince over 8 yearsTry
netstat -np
note the missing l -
Admin over 8 yearsstill no good. -n works