Redirect Only Errors to StdOut

The most usual thing I want with redirect is just throwing errors to null:

Terminal
command >/dev/null

Alternatively, one can throw everything to null:

Terminal
command >/dev/null 2>1

However, what if you want only error being shown and proper output ignored? Well, there is a redirect for that too:

Terminal
command 2>1 >/dev/null

Leave a Reply

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