Standard Imuro and pipelines
Standard Imuro and pipelines
>: redirect the standard output to the file, the file content will be overwritten > >: redirect the standard output to the file, based on the original content, add content 2 >: redirect the standard error to the file and overwrite it. 2 > >: redirect the standard error to the file and append it. & >: indicates merging standard output and error output override redirection & > >: redirects standard output and standard error 2 > & 1: indicates the same meaning & > that is, merging standard output and error output override redirection; & > or > & or 2 > & 1: redirects standard output and standard error to a file as the same data stream >
Example: append who to / data/test.log file
2 >
Example: put the right ones in the F1 file and the wrong ones in the f2 file
& >
Example: put all the right and wrong in the all.log file
Set-C/set + C
Example: prohibit overwriting the hostname to the all.log file / remove the prohibited overwrite
\ > |
Example: force all.log file to be overwritten
(.)
Example: redirect the execution results of both date and cal commands to the all.log file
<
Example: write the contents of the f1.log file to the f3.log file