Andrew's Digital Garden

Pipes in Bash

Using the | pipe operator allows you to send the output of one command as input to another command.

Multiple commands can be chained to create a pipeline.

command 1 | command2 | command3

To run a series of commands in sequential order without passing output/input, use the following operators:

&& - run command if the last one did not fail (zero exit status code) || - run command if the last one failed (non-zero exit status code) ; - run command regardless of the last exit code

[[shell]]

Pipes in Bash