Use of output, error, output append, error pursuit and emphasis orientation
The use of output, error, output append, error pursuit and emphasis orientation not only makes it easy for us to implement the contents of multiple commands in a single file, but also gives us a deeper understanding of Linux.
Program: instruction + data
Read in data: Input
Output data: Output
All open files have a fd: file descriptor (file descriptor)
Linux provides the program with three iBand O devices.
Standard input (STDIN)-0 accepts input from the keyboard by default
Standard output (STDOUT)-1 default output to terminal window
Standard error (STDERR)-2 default output to terminal window
1. Create a file using output redirection
two。 Use of output redirection
3. Output append redirection
4. Output redirection of error command
5. You can use 2 > to redirect the output of the error command.
6. Error command output append redirection
7. Show incorrect and correct output redirection with the same file
8. You can also use 2 > & 1 to output both incorrect and correct output redirections
9. Use different files to show the wrong and the right
10. You can use set-C to redirect output without overwriting the contents of the original file.
11. Use > | Force overwrite
twelve。 Unlock set + C
More than 13 commands output redirection simultaneously