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?

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

Don't blame me for the fact that competent programming, as I view it as an intellectual possibility, will be too difficult for "the average programmer" — you must not fall into the trap of rejecting a surgical technique because it is beyond the capabilities of the barber in his shop around the corner. (Edsger W. Dijkstra)

This post tagged: