Which process, which TCP port ?

Technote (FAQ)


Question

How do I determine which process is running on which port ?

Cause

Port number is already in use.

Answer

Either specify a different port which is not being used by any other process or terminate the application that is using it.

Use the following commands to determine what process is using the port.
In any instance, replace generic "port_number" occurrence with the specific port value.

Windows:
netstat -nao | findstr port_number
The last column shows the PID information.

Linux:
netstat -nap | grep port_number
The last column shows the PID/Program name information.

AIX:
1. netstat -Aan | grep port_number
The hex number in the first column is the address of protocol control block (PCB)
2. rmsock "addr of PCB" tcpcb This command shows the process who is holding the socket. Note that this command must be run as root.

Solaris:
for pid in `ps -ef|grep -v UID|awk '{ print $2 }'`; do pfiles $pid 2>/dev/null|awk '/^[0-9]/ {pid_line=$0} /port: port_number/ {print pid_line; print}'; done
The first line shows the process ID information.

HP-UX:
for pid in `ps -ef|grep -v UID|awk '{ print $2 }'`; do pfiles $pid 2>/dev/null|awk '/^[0-9]/ {pid_line=$0} /localaddr\/port =.*port_number.*remaddr\/port =/ {print pid_line; print substr($0,0,index($0,"remaddr")-1); exit}'; done
The first line shows the process ID information.


Cross reference information
Segment Product Component Platform Version Edition
Storage Management Tivoli Storage Productivity Center Basic Edition Windows, AIX, Linux All Editions

Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

Tivoli Storage Productivity Center Standard Edition

Software version:

3.3, 3.3.2, 4.2.1, 4.2.2

Operating system(s):

AIX, Linux, Windows

Software edition:

All Editions

Reference #:

1605791

Modified date:

2013-01-30

Translate my page

Machine Translation

Content navigation