How to check which process is occupying port 80 in Linux

青灯夜游
Release: 2022-07-18 18:29:40
Original
8286 people have browsed it

Two viewing methods: 1. Use the fuser command to directly check which process the specified port is occupied on Linux. The syntax is "fuser -v 80/tcp", and the running result will include the name of the process. and id. 2. Use the lsof command to find the corresponding process information based on the specified port. The syntax is "lsof -i:80". You can view the process information occupying port 80 in the output result.

How to check which process is occupying port 80 in Linux

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

There are two ways to check which process a port is occupied in Linux.

Use the fuser command

Use the fuser command to directly check which process the port is occupied on Linux

fuser 80/tcp
Copy after login

Above Use the command to check which process is occupying port 80. You may see results similar to the following:

How to check which process is occupying port 80 in Linux

If you want to see details, you can add the -v switch, and the running results will include the process Name:

fuser -v 80/tcp
Copy after login

How to check which process is occupying port 80 in Linux

If you want to kill the process, you can use the -k switch

fuser -k 80/tcp
Copy after login

Use lsof

lsof command, the abbreviation of "list opened files", literally translated, is to list the files that have been opened in the system. Through the lsof command, we can find the corresponding process information based on the file, and we can also find the file opened by the process based on the process information.

Use the lsof command to find the corresponding process information based on the specified port.

Enter the following command:

lsof -i:80
Copy after login

The running result is similar to the screenshot below:

How to check which process is occupying port 80 in Linux

Related recommendations: "Linux Video Tutorial

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template