The parameters of the netstat command are described as follows:
-t: indicates that the TCP port is displayed.
-u: indicates that UDP port is displayed.
-l: Only monitor sockets are displayed (sockets are programs that enable applications to read, write, send and receive communication protocols and data).
-p: Displays the process identifier and program name, and each socket/port belongs to a program.
-n: display IP without DNS polling (this will speed up the operation)
You can display all the ports and process services on the current server, and you can view the specific ports and services in combination with grep. ...
Netstat -ntlp // View all current tcp ports.
netstat -ntulp |grep? 80 // View the usage of all 80 ports.
Netstat -an | grep 3306 // View the usage of all 3306 ports.
For example, to check whether the current Mysql default port 3306 is started, you can do the following.