使用 bash 将输出发送到文件时 > 的正式名称是什么

Zor*_*ora 2 bash

在 Ruby 中,>> 被称为铲操作符。例如,在 bash 中它叫什么

cat "hello world" >> file.txt
Run Code Online (Sandbox Code Playgroud)

它如何使用正确的命名法解释这是做什么的。我听说它被称为“管道”,但管道是 | 所以我很困惑。

Dav*_*ill 5

>将输出发送到文件时的正式名称是什么

这是一个重定向操作符。

笔记:

命令的输入和输出都可以重定向:

 command  >  filename    Redirect command output (stdout) into a file

 command  >  /dev/null   Discard stdout of command

 command  2> filename    Redirect error output (stderr) to a file

 command  2>&1 filename  Redirect stderr to stdout 

 command  1>&2 filename  Redirect stdout to stderr

 command  >> filename    Redirect command output and APPEND into a file

 command  <  filename    Redirect a file into a command

 commandA  < (commandB)  Redirect the output of commandB as file input to commandA

 commandA | tee filename | commandB    Redirect commandA into filename AND commandB

 commandA | commandB     Redirect stdout of commandA to commandB

 commandA |& commandB    Redirect stdERR of commandA to commandB
Run Code Online (Sandbox Code Playgroud)

源操作方法:重定向和进程替换 - Linux - SS64.com

有关的: