Use the netstat command to view the ports that are listening

Use the netstat command to view the port that is listening:

1. netstat -nupl //n indicates the port number in digital form, u indicates the UDP protocol type, p indicates the program PID, and l indicates the listening status;

2. netstat -nuplF | grep 3306 //This means to find the process that is listening and the port number is 3306.

You can use the lsof command to check whether a port is open.
Check that the port can be used in this way. I will take port 80 as an example:
lsof -i:80
If there is a display, it means that it has been opened. If there is no display, it means that it is not open.

Reference: https://zhidao.baidu.com/question/82236788.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326439815&siteId=291194637