Skip to content

Pipes — joining commands · ⁨管道 —— 把命令连起来⁩

English

The big idea: pipes

  • This is what makes the shell powerful. A pipe | sends one command's output straight into the next command:
  • cat produces the lines; sort receives them and puts them in order. No file in between.

中文

核心思想:管道

  • 这正是 shell 强大的原因。管道 | 把一个命令的输出,直接送进下一个命令:
cat fruits.txt | sort
  • cat 产生这些行;sort 接收它们并排好序。中间不需要任何文件。

管道把一个命令的输出直接送给下一个:cat | sort | uniq

Log in or create account · ⁨登录或创建账户⁩

IGCSE, A-Level · ⁨IGCSE、A-Level⁩ & AP · ⁨与 AP⁩