Find the Process run by nohup command

2vision2 picture 2vision2 · Jan 4, 2013 · Viewed 40.3k times · Source

I run a server executable in Centos using the following command "nohup server &". Now I need to kill the process "server". But I tried "ps -a" command to get the PID but I couldnt get the process. Now how to kill the "server" now?

Answer

Usman Saleem picture Usman Saleem · Jan 4, 2013

ps auxwww|grep -i 'server' should return all process which has server in them. Otherwise, server may have already stopped.

You should be able to determine the PID (and store it in a file) as follows:

nohup server &
print $! >> my_server.pid