What does "|&" mean in Bash?
Solution 1:
From man 1 bash
, section Pipelines:
[time [-p]] [ ! ] command [ [|⎪|&] command2 ... ]
If |& is used,
command
's standard error, in addition to its standard output, is connected tocommand2
's standard input through the pipe
So it is just like the pipe operator |
, but piping both standard output and standard error.
Solution 2:
This operator pipes both standard output and standard error from the left hand side to the right hand side.
The Bash reference manual has a comprehensive index of all operators where you can look up these operators.