linux - view port status

How to check port status in Linux

 

Method step family:

1. During the use of Linux, you need to know which ports are opened by the current system, and to view the specific processes and users who open these ports, you can simply query through the netstat command

 

2. The parameters of the netstat command are described as follows:

  -t : specify to display the TCP port

  -u : specify to display the UDP port

  -l : Display only listening sockets (the so-called sockets are programs that enable applications to read, write and send and receive communication protocols and data)

  -p : Display process identifier and program name, each socket/port belongs to a program.

  -n : Do not perform DNS polling, display IP (can speed up operation)

 

3. All ports and process services on the current server can be displayed. Combined with grep, you can view a specific port and service status.

      netstat -ntlp //View all current tcp ports ·

      netstat -ntulp |grep 80 //View all 80 port usage ·

      netstat -an | grep 3306 //View all 3306 port usage ·

 

4. For example, to check whether the current Mysql default port 3306 is enabled, you can do the following operations


 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326638291&siteId=291194637