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 &
Written by Bartłomiej Danek
Related protips
4 Responses

thanks @mhitza, fixed!
over 1 year ago
·

It's also useful while working with cron.
over 1 year ago
·

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
·

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
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#