ls FilamentosFileNotExist 2<&1 ||& grep -v acc
ls FileNotExist 2<&1 | grep -v acc
In this example, command1 is executed, and both its output and any error messages are piped directly into command2. This can be particularly useful when you want to filter or process the output and errors of a command in the same way.
The |& operator is equivalent to 2>&1 |, which explicitly redirects stderr (file descriptor 2) to stdout (file descriptor 1), and then pipes the combined output to another command.
Remember, this operator is specific to the Bash shell, and might not be available in other shells. If you’re using a different shell that doesn’t support |&, you would need to use the longer form 2>&1 | to achieve the same result.