Finding Process Info Associated to a Given Port in HP-UX

7,599

Follow these steps:

  1. 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.

  2. 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
    
Share:
7,599

Related videos on Youtube

Juanal
Author by

Juanal

Updated on September 18, 2022

Comments

  • Juanal
    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
    Admin over 8 years
  • Admin
    Admin over 8 years
    Doesn't work on HPUX: # netstat -nlp netstat: illegal option -- l
  • Kaiden Prince
    Kaiden Prince over 8 years
    Try netstat -np note the missing l
  • Admin
    Admin over 8 years
    still no good. -n works