Current location - Quotes Website - Team slogan - How does linux check whether the port is occupied?
How does linux check whether the port is occupied?
How to check which process the port is occupied in linux;

①lsof -i: port number

, used to check the occupancy rate of a port, such as the usage of port 22, lsof -i:22, as shown in the figure below.

(2) ②netstat -tunlp|grep port number, which is used to check the progress of the specified port number. For example, check the situation of port 22, netstat -tunlp|grep 22, as shown in the following figure.