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

前端 未结 13 1840
醉酒成梦
醉酒成梦 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:44

    suppose i am running ruby script in the background with below command

    nohup ruby script.rb &
    

    then i can get the pid of above background process by specifying command name. In my case command is ruby.

    ps -ef | grep ruby
    

    output

    ubuntu   25938 25742  0 05:16 pts/0    00:00:00 ruby test.rb
    

    Now you can easily kill the process by using kill command

    kill 25938
    
    0 讨论(0)
提交回复
热议问题