Linux can use the lsof command to check the occupancy of port 80. The specific steps are: 1. Open the terminal; 2. Run the "sudo lsof -i :80" command to check the processes occupying port 80.
The operating system of this tutorial: Linux5.18.14 system, Dell G3 computer.
On Linux, you can use the lsof command to see which process is occupying a specific port. The following are the specific steps:
1. Open the terminal.
2. Run the following command to view the processes occupying port 80:
sudo lsof -i :80
If port 80 is occupied, a list of processes using this port will be displayed.
If the lsof command is not installed, you can install it through a package manager (such as apt, yum, etc.). Please choose the corresponding command according to your Linux distribution.
Also, if you just want to view the processes and programs currently listening on all ports, you can use the following command:
sudo netstat -tlnp
This will display all listening ports and their related process information. You can find the process corresponding to port 80 in the output.
The above is the detailed content of How to check which process is occupying port 80 in Linux. For more information, please follow other related articles on the PHP Chinese website!