Home > Article > Operation and Maintenance > How to check if a port is open in Linux
First we open the Linux command operation interface to view the port, as shown in the figure:
In order to get more information High authority (view all ports), switch to root user login here
Free video tutorial sharing:linux video tutorial
One way is to use the lsof
command, taking 80 as an example, as shown in the figure:
If there is no output, it means that the function is not enabled. The port number.
In order to facilitate testing, I detect an open port number here, and the information as shown in the figure will be output:
The second method is to use netstat -aptn command line, view all open port numbers
The command shown in the picture is to view all port numbers using the udp protocol in the system
This command is to view the port number information using the tcp protocol in the system
Related video tutorial sharing: linux tutorial
The above is the detailed content of How to check if a port is open in Linux. For more information, please follow other related articles on the PHP Chinese website!