oynjxq
Last Updated: July 06, 2018
·
1.162K
· bartlomiejdanek

Execute unix shell command in background

It might be helpful when you don't need output, example with ls command:

ls > /dev/null 2>&1 &

4 Responses
Add your response

3117

thanks @mhitza, fixed!

over 1 year ago ·
3299

It's also useful while working with cron.

over 1 year ago ·
15697

Sometimes its nice to do it without the stderr redirection (the 2>&1 part) and still see problems while its running. Even if its forked stderr will show in your shell. Same for cron, you wont loose those messages (will be in log).

over 1 year ago ·
17613

If you combine it with nohup or screen, you can even log out without the program being terminated.
http://en.wikipedia.org/wiki/Nohup
http://en.wikipedia.org/wiki/GNU_Screen

over 1 year ago ·