Command chaining
Syntax
Description
command1 && command2
Executes command2
only if command1
succeeds.
command1 || command2
Executes command2
only if command1
fails.
command1 ; command2
Executes command1
and then command2
, regardless of the outcome of command1
.
command1 | command2
Executes command1
and send the output of command1 to command2
.
`command`
or $(command)
Executes command
and replaces it with its output.
Last updated