[linux] nohup - keeps job running at backend

Normally we log in a Linux machine using ssh. And when we logs out, those jobs started by the shell will get killed if they're not deamon or running at backend. nohup is a useful tool to keep the job running at backend to prevent this "auto killed" behavior from happening.

Here's how to use it:

# nohup myjob &


We'll see something printed out:

appending output to nohup.out 


Meaning it's up. All the output info of myjob will be kept in nohup.out of the current directory.

If we logout, myjob will keep running at the backend.

To kill myjob, normally we use the command below to find out the pid, and use the kill command to stop the process.

ps -A | grep myjob

你可能感兴趣的:(linux,ssh,UP)