In Linux, check which process the port is occupied by, the configuration file and directory called by the process, etc.

1. Check the process of the occupied port,netstat/ss -antulp | grep :端口号

Please add image description

2. Through the above command, you can list which applications this port is occupied, and then find the corresponding process PID.

Please add image description

3. Query the process based on PID. If you want to view this process in detail and which process the PID is, you can view the detailed information of the process through commands, ps -ef | grep 进程PIDor ps -aux | grep 进程PID

Please add image descriptionPlease add image description

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, configuration files and other information.

4. Check the directory where the process is located. Through ll /proc/进程PID/cwd the command, you can directly view the directory where the process is located, so that you can quickly locate the directory of the process.

Please add image description

After searching its process directory, you can perform a series of operations on this application, such as restarting, deleting, etc.!

[Personal public account]

【暴科技】、【非著名运维】 --》 公众号回复 “资料” 送运维自学资料大礼包哦!I will also share some operation and maintenance and technological knowledge above. Please pay attention to it. Thank you all.

Guess you like

Origin blog.csdn.net/qq_44895681/article/details/131001048