Get rid of unwanted output from bash command

I used to redirect the output to /dev/null, but sometimes it’s not good enough. It’s much better to just turn off stdout and stderr.

$ command 1>&- 2>&- &

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">