Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
What is |& syntax means? For example:
|&
tree |& less
I see no difference with tree |& less.
从bash 手册:
command1 [ [| or |&] command2 …]
如果|&使用,标准错误通过管道command1连接到标准输入;command2它是 的简写2>&1 |。标准错误的这种隐式重定向在命令指定的任何重定向之后执行。
command1
command2
2>&1 |
在zsh|&中也是2>&1 |