APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

2003/12/04 nohup

Run a command that won't be killed when you log out.

When you log out or are otherwise disconnected, a hangup signal is sent to all your processes. Using nohup causes those signals to be ignored:


nohup myscript > myscript.out 2>&1 &
 

If you just do:


nohup myscript &
 

any output from "myscript" will be sent to "nohup.out" which will be created or appended to.

Make sure "myscript" doesn't read from standard input; that won't work without redirection:

nohup myscript < answers &                           
 

Note that you need "&" to put the command in background; nohup doesn't do that for you.



Got something to add? Send me email.




Increase ad revenue 50-250% with Ezoic


More Articles by

Find me on Google+

© Tony Lawrence



Kerio Samepage


Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us





A learning experience is one of those things that say, "You know that thing you just did? Don't do that." (Douglas Adams)





This post tagged: