Linux study notes one

The Linux system has a very important application in the server field, and the remote ssh connection to the server is also a necessary operation. However, some programs want to run in the background. Generally speaking, after exiting the ssh window, the program continues to run.

1. Commands that need to be run in the background:

nohup java -jar tale-least.jar >1.file>&1&

Now that the program is running in the background, we need to exit it. Before exiting, we need to find out the PID of the running program.

2. Find the PID command of the program occupying a port:

yum install lsof -y   // Install lsof 
lsof -i:8080 // View the occupants of port 8080
 // Return COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
 //java 13069 root 15u IPv4 521380 0t0 TCP *:webcache (LISTEN )

At this point we have found the background running program occupying the port, and then we need to kill it

Three, kill a PID command:

kill 2 -13069

The above command means to kill the program whose PID number is 13069.

In this way, the most important background running program of our server part, the diary of finding and exiting the background program is completed, thank you.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325348201&siteId=291194637