Redirect Only Errors to StdOut

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

command >/dev/null

Alternatively, one can throw everything to null:

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:

command 2>1 >/dev/null

Leave a Reply

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