Last active
July 19, 2018 20:24
-
-
Save weirdpattern/ce54fdb1e5621b5966e146026995b974 to your computer and use it in GitHub Desktop.
.2016.08.31.stream-redirection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2016.08.31.stream-redirection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# no redirection | |
$ echo 'hello' | |
hello | |
# redirects standard error (no error in this case) | |
$ echo 'hello' 2> /dev/null | |
hello | |
# 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 unexisting-file.sh | |
unlink: unexisting-file.sh: No such file or directory | |
# redirects standard error to /dev/null (so no error) | |
$ unlink unexisting-file.sh 2> /dev/null | |
# redirects everything to /dev/null (so no error) | |
$ unlink unexisting-file.sh &> /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<operation> [n]> /dev/null [options] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment