Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# no redirection
$ echo 'hello'
# redirects standard error (no error in this case)
$ echo 'hello' 2> /dev/null
# redirects standard out to /dev/null (so no output)
$ echo 'hello' 1> /dev/null
# redirects everything to /dev/null (so no output)
$ echo 'hello' &> /dev/null
# no redirection (causing error)
$ unlink
unlink: No such file or directory
# redirects standard error to /dev/null (so no error)
$ unlink 2> /dev/null
# redirects everything to /dev/null (so no error)
$ unlink &> /dev/null
<operation> [n]> /dev/null [options]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.