The open source “lsof” tool is great for determining what process has a port open. Unfortunately lsof isn’t included with AIX so if you just want to quickly identify which process is using a port and you don’t have lsof you can use “netstat -Aan” combined with the “rmsock” command.
For example, lets say I want to identify which process is listening on port 1334. I would first run:
You then take the first column (f100050000b05bb8 in this example) and run the following command:
You can see that port 1334 is open by the writesrv process with PID 5767378.
If you want to see all of the TCP listening ports and which processes and PID’s are assigned to them, run the following scri pt :
Here is example output from the script:
