How to check which process a Linux port is occupied by: first check the process of the occupied port and query the process ID; then query the process according to the integrated ID and check the process details; finally check the directory where the operation is performed Just process.
The operating environment of this tutorial: red hat enterprise linux 6.1, DELL G3 computer.
How to check which process a Linux port is occupied by:
1. Query the occupied port. First, you need to enter a command to check the process of the occupied port, netstat -tunpl |grep port number
2, query the process ID. Through the above command, you can list which applications this port is occupied, and then find the corresponding process ID,
3. Query the process according to the integration ID. If you want to view this process in detail and which process the ID is, you can view the detailed information of the process through the command, ps -ef|grep process ID
4, View process details. By executing the above command, you can see the detailed information of the process, and you can also see the directory where the process exists, the files executed by the process and other information,
5 , check the directory where the process is located. Through the ll /proc/process ID/cwd command, you can directly view the directory where the process is located, so that you can quickly locate the directory of the process,
7. Operate the process. After searching his new car catalog, you can perform a series of operations on this application, such as restarting, deleting, etc.
Related learning recommendations: linux video tutorial
The above is the detailed content of How to check which process a linux port is occupied by. For more information, please follow other related articles on the PHP Chinese website!