Last active
December 20, 2015 04:29
-
-
Save pankajparashar-zz/6071373 to your computer and use it in GitHub Desktop.
All about redirection - 0(stdin) 1(stdout) 2(stderr)
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
1. redirect stdout to a file | |
ls -l > ls-l.txt | |
2. redirect stderr to a file | |
grep da * 2> grep-errors.txt | |
3. redirect stdout to a stderr | |
grep da * 1>&2 | |
4. redirect stderr to a stdout | |
grep * 2>&1 | |
5. redirect stderr and stdout to a file | |
rm -f $(find / -name core) &> /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment