First open the Linux command operation interface, as shown in the figure (this article takes the Ubuntu system as an example):
Then in order To obtain higher permissions (i.e. view all ports), switch to root user login
Free online video tutorial sharing:linux video tutorial
Method 1: Use the lsof command, taking port 80 as an example, as shown in the figure:
If there is no output, it means that the port number is not opened. In order to facilitate testing, this article detects an open port number, and the information shown in the figure will be output:
Method 2: Use the netstat
command, View all open port numbers
The command shown in the figure below is to view all port numbers using the udp protocol in the system
Related article tutorial sharing: linux tutorial
The above is the detailed content of How to check whether the port is open in linux. For more information, please follow other related articles on the PHP Chinese website!