Overview
- Input/Output redirection is supported in the Linux Shell environment, expressed by the symbols "<" and "> ".
- 0 indicates standard input.
- 1 indicates standard output
- 2 indicates standard error message output
0, 1, and 2 can be used to specify the standard input or output to be redirected, for example, 2>/tmp/error.txt indicates to output the error information to the/tmp/error.txt file./dev/nulllinux has a special file/dev/null, it is like a bottomless pit, and all the information redirected to it will disappear without a trace. This is very useful. When we do not need to display all information about the program, we can redirect the output to/dev/null. If we want to display both normal output and error information, the standard output and standard error must be redirected to/dev/null. For example, the standard output must be redirected to/dev/null.
Note that when 0, 1, and 2 are redirected, do not add spaces to the "with"> "symbol.