I'm running my program in Linux server using:
我使用以下命令在Linux服务器上运行我的程序:
$ nohup <your_script> &
It keeps running as I wanted. But I want to stop it. Do anybody know how to do it?
它按我的意愿继续运行。但我想阻止它。有谁知道怎么做?
2 个解决方案
#1
2
Find the process ID, then kill the process:
找到进程ID,然后终止进程:
ps aux | grep <your_script>
The second number is your PID, take that number and pass it to kill
:
第二个数字是你的PID,取这个数字并传递给kill:
kill -9 <PID>
Alternatively, you can also use killall
:
或者,您也可以使用killall:
killall <your_script>
#2
2
Get the pid of the process with ps, and then run kill:
使用ps获取进程的pid,然后运行kill:
Kill -9 pid
#1
2
Find the process ID, then kill the process:
找到进程ID,然后终止进程:
ps aux | grep <your_script>
The second number is your PID, take that number and pass it to kill
:
第二个数字是你的PID,取这个数字并传递给kill:
kill -9 <PID>
Alternatively, you can also use killall
:
或者,您也可以使用killall:
killall <your_script>
#2
2
Get the pid of the process with ps, and then run kill:
使用ps获取进程的pid,然后运行kill:
Kill -9 pid