Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find the Process run by nohup command

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?

like image 739
2vision2 Avatar asked Jan 04 '13 06:01

2vision2


People also ask

How do I find a nohup file?

nohup. out file will be in location of your present working directory ,pwd. (the directory from where you executed command).

How do I run a nohup command?

To run a nohup command in the background, add an & (ampersand) to the end of the command. If the standard error is displayed on the terminal and if the standard output is neither displayed on the terminal, nor sent to the output file specified by the user (the default output file is nohup. out), both the ./nohup.

What is use of nohup command in Linux?

Nohup, short for no hang up is a command in Linux systems that keep processes running even after exiting the shell or terminal. Nohup prevents the processes or jobs from receiving the SIGHUP (Signal Hang UP) signal. This is a signal that is sent to a process upon closing or exiting the terminal.

How do I exit after nohup?

Ending the nohup command with an & makes the command run in the background, even after you exit the shell. To exit the shell in this situation, enter the exit command. nohup ensures that the command does not end when the creating process ends.


1 Answers

There is no definitive way to catch the exact process with the help of ps command, but you can use the following:

ps -a | grep "server"

You will get a list of all the processes running with the name "server"

Or, you can use any other keywords as well to grep the ps output.

like image 93
Arpit Avatar answered Sep 28 '22 13:09

Arpit