Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Use of output, error, output append, error pursuit and emphasis orientation

Shulou Source: shulou.com Published: 2022-06-01 07:06:55 10月01日 Update

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

Tags: Output error file command content data standard at the same time program terminal input different deeper can make multiple multiple instruction device keyboard don't come Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information MySQL Apple Shulou Tech Info Linux