Current location - Quotes Website - Team slogan - Linux port processes View Linux port processes.
Linux port processes View Linux port processes.
In AIX, which command can see which processes are using which port?

AIX has no command to directly check which process is using which port, unlike Linux, which can use lsof or netstat-p to check. At present, you can use the following methods to view:

1. First, use netstat to list the ports used. Please note that an extra parameter -A is required.

#netstat-Aan

f 100050002d 32 bb 8 TCP 600 * . 22 *。 * Listen

f 100050002d 3 138 btcp 400 * . 22 *。 * Listen to the example above and list the situation of port 22.

2. Use the command rmsock to check again. Note: This command is used to clear a socket without a related file descriptor. If the socket is occupied by a process, it will prompt which process the port is used by, and use this prompt information to obtain process information. take for example

# rmsockf 100050002d 3 13b 8 tcpcb

Socket 0xf10050002d31008 is implemented through process 5374084 (sshd). It shows that port 22 is occupied by process sshd (process number 5374084).

If you know that your operation will not affect the system, or just for testing, you can use the following loop to grab it:

netstat-anA | grep-wLISTEN | awk ' { print $ 1,$5}'|whilereadpcbport

do

echo"$port ->"

rmsock$pcbtcpcb

finished

How to check which ports are located in listening state under Linux?

Use the netstst command to view the ports in listening state:

1, netstat-nupl//n/n indicates that the port number is displayed in digital form, u indicates the UDP protocol type, p indicates the program PID, and l indicates that it is in listening state;

2.netstat-nuplf|grep3306// This means that the process with port number 3306 is located in listening state.

Linux can run multiple processes on a single port. For example, if I open two browsers at the same time, how many ports does it belong to?

Many processes can run on each port, and each process can call the same port, but when one process occupies the port, other processes will wait until the previous process releases the port before being called by the next process.