How to get the process ID to kill a nohup process?

前端 未结 13 1982
醉酒成梦
醉酒成梦 2020-11-27 08:53

I\'m running a nohup process on the server. When I try to kill it my putty console closes instead.

this is how I try to find the process ID:

ps -ef |         


        
13条回答
  •  醉酒成梦
    2020-11-27 09:41

    Suppose you are executing a java program with nohup you can get java process id by

    `ps aux | grep java`
    

    output

    xxxxx     9643  0.0  0.0  14232   968 pts/2   
    

    then you can kill the process by typing

    sudo kill 9643
    

    or lets say that you need to kill all the java processes then just use

    sudo killall java
    

    this command kills all the java processors. you can use this with process. just give the process name at the end of the command

    sudo killall {processName}
    

提交回复
热议问题