Linux: nohup: Execute a command after exiting a shell

This is quite useful. I used to push jobs to the background and then exit shell, but it wasn’t an easy task considering I have short term memory issues (not a complete retard, just too much on my mind ;)). I found this awesome little command to have the commands or scripts run right after I’m off the wagon!

nohup

That’s it… simply run your comman with it:
nohup command

Don’t forget the ampersand at the end. Use absolute path for scripts:
nohup ~/script &

If your scripts requires additional options to run, use a quote right before the ampersand:
nohup ~/script "start" &

Note that you don’t need to use this for your wget command… wget comes with a built-in switch (b):
wget -b

Have fun!

2 thoughts on “Linux: nohup: Execute a command after exiting a shell

  1. Thomas says:

    A much smarter way to do it would be to run things like this in screen. It allows you to just detach the screen and go back later and look at what it did.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.