Without further mention, this article describes the general Linux operations: look at the port hosting process and kill the process based on the PID. Also add: view process PID by program name.
First, two commands, the lsof command and the netstat command.
Lsof command 1, check the PID of the process holding port:
Lsof -i:{port number}
Select * from PID where id = ‘kill’;
kill -9 {PID}
Select PID from the process that is hosting port;
netstat -tunlp|grep {port}
2, kill method as above.
kill -9 {PID}
Add 1: View the corresponding PID according to the program name 1, with PS command (ZB only) :
ps -ef | grep {programName}
kill -9 {PID}
View the detailed memory footprint
ps aux -u root | grep {programName}
2. Use the pgrep command:
The p of the pgrep command indicates that the command is grep specifically for process queries.
pgrep {programName}
kill -9 {PID}
Supplement 2: View the corresponding process according to PID
ps -aux |grep -v grep|grep {$PID}
If you want to learn more about the technology, please add me to learn about it