Dec 21

Using ‘nohup’ to persist a process even after logging out

Tag: LinuxDan @ 3:52 pm

Spent a while today trying to remember this command. I needed it to persist a one-off backup process which I needed to leave running. I knew I seen this done before but couldn’t remember the command. My initial searches kept turning up the wrong info. Now I’ve found it I don’t want to forget it again.

Basically you use the ‘nohup’ command which runs another command and immunizes it against hangup signals. You also have to use the ‘&’ shell operator to run this process in the background. Then you can log out of your terminal and leave the process to run. E.g.

  $ nohup myprocess &

Leave a Reply

*
To prove you're a person (not a spam script), type the answer to the math equation shown in the picture. Click on the picture to hear an audio file of the equation.
Click to hear an audio file of the anti-spam equation