Linux background process - the nohup command

Linux nohup FAQ: What is the Linux nohup command? Can you share an example of how it's used?

So you want to log off and go home for the night, but you need to run a job (process) on your Linux or Unix system that's going to take a couple of hours? Fear not, the Linux nohup command ("no hangup") will help you out.

Start a Linux background process with nohup

As a simple example, assume that you have a Linux command named myLongRunningJob.sh that you want to run, but you know if will take over three hours to run. Just submit the job using the nohup ("no hang up") command as shown below, and you should be good to go:

nohup myLongRunningJob.sh &

Of course make sure you test the program that you want to run as a background process to know that it is really set up properly to run, otherwise you'll be in for a disappointment in the morning.

Other than that, if your Linux command is set up properly, the nohup command should keep your background process running in the background while you go home. You can safely log out, and find your results waiting for you in the morning.

 

Thanks for the tip. Used this

Thanks for the tip. Used this today.

Post new comment

The content of this field is kept private and will not be shown publicly.