Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

4.3 piping and redirection

Shulou Source: shulou.com Published: 2022-06-03 06:42:46 09月23日 Update

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

Tags: Output file standard input command device user directory error control content function memory bus instruction data storage pipe number controller Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux NVidia Apple Shulou Tech Info Shulou Technology