4.3 piping and redirection
Pipes and redirects: >
< >> / tmp/var.out overwrite output (overwrite original content)
> >: append output
/ *
Set built-in commands:
-C (overrides are not allowed)-enable the function
+ C (restore override) + turn off function
Ls / var > | / tmp/var.out (- C does not work)
* * /
Set-C: prohibit the use of override redirection on existing files
If the output is forcibly overwritten, use > |
Set + C: turn off the above functions
2 >: redirect error output
2 > >: append method
Ls / varr > / tmp/var3.out 2 > / tmp/err.out (two redirects)
& >: redirect standard output or error output to the same file
& > >: append method
Ls / var6 & > / tmp/var0.out