During Linux use, you need to know which ports are open to the current system, and to see the specific processes and users that open those ports, you can simply query by using the netstat command 2
The netstat command parameters are described below:
-T: Indicates that the TCP port is displayed
-U: Indicates that the UDP port is displayed
-L: Monitor sockets only (so-called sockets are programs that enable applications to read and receive communication protocols (protocol) and data)
-P: Displays the process identifier and program name, each socket/port belongs to a program.
-N: Do not perform DNS polling, display IP (can accelerate operation) 3
To display all ports and process services on the current server, and to view a specific port and service situation in the grep combination. ·
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 ·