Finding the process that locked a port in AIX

Posted: November 22, 2013 in HowTo
Tags: , , , ,

Run the following command to check if port is in use

# netstat -an | grep <port number>

If above returns the connection, then run the following command to get the address of the port number

# netstat -Aan | grep <port number>

Once you have the address of the port number, run the following command to get the process id that is using the port.

# rmsock <address of port number> tcpcb

Example

# netstat -an | grep 30767
tcp4       0      0  *.30767                *.*                    LISTEN
# netstat -Aan | grep 30767
f100060001b2f398 tcp4       0      0  *.30767            *.*                LISTEN
# rmsock f100060001b2f398 tcpcb
The socket 0x1b2f008 is being held by proccess 942150 (vcs_agent).
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s