Bash Redirect all output to /dev/null

Bash Redirect all output to /dev/null

Sometimes I just dont want any output from a bash command. I’m putting this here so I dont forget how to stop it.

This come up from time to time. When I’m running a bash sript and I want all the output to be redirected to /dev/null

Sticking > /dev/null 2>&11 at the end of a command will send all output to /dev/null, this goes for both the stdout and stderr.


© 2020. Some rights reserved. The contents of this site is released under a Creative Commons Attribution-Share Alike license.