Check which process occupies a port on AIX

Source: Internet
Author: User

Address: http://blog.chinaunix.net/u2/83758/showart_1832458.html

Problem description:

In the process of system management, it is often encountered that the port is occupied when a process is started. For example, port 9090 is often occupied when the WebSphere console is started. Use
Netstat-an |
Grep 9090 can see that the port is being listened on, but it does not know which process occupies the port. Of course, it can also change the port but it is troublesome. If you can find out which process occupies the port,
Kill the process.

Solution:

1. netstat-aan | grep <portnumber>

Find the corresponding port connection
PCB/ADDR
And connection protocol type.

Note: PCB ---- Protocol control block

2.
If yes
TCP
Connection, then
Rmsock <PCB/ADDR> tcpcb

If yes
UDP
Connection, then
Rmsock <PCB/ADDR> inpcb Next we will
Telnet
The
23
Port number is used as an example to describe this method:

# Netstat-aan | grep 23
F1000200019ce398 TCP 0 0 *. 23 *. * listen

We can see that
PCB/ADDR
Is
F1000200019ce398
And the protocol type is
TCP
. # Rmsock f1000200019ce398 tcpcb
The socket 0x19ce008 is being held by proccess 185006 (inetd ).

Command to report that the port is being
Inetd
Process usage,
PID
Is
185006
.

Note:
Rmsock
Command needs
Root
Permission execution.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.