Below are some commonly used chaining operators which you can use with different commands:
Chaining Operator | Description |
---|---|
& (Ampersand) | This sends a command, script, or process to the background. In short, it makes a command run in the background. |
&& (Logical AND) | The && operator will only execute the second command if the first command SUCCEEDS! , in other words, if the first command exits with a zero status. |
; (Semi-colon) | The command following this operator will execute even if the command preceding this operator is not successfully executed. |
! (NOT) | The NOT is much like the except statement. It will run all the commands except a given condition. It negates an expression within a command. |
&&- | |
(Pipe) | |
>,>>, < (Input-OutputRedirection) | Redirects the output of a command or a group of commands to a file or stream. |
\ (Concatenation) | Used to concatenate large commands over several lines in the shell. |
() (Precedence) | Allows the commands to execute in precedence order. |
{} (Combination) | The execution of the command succeeding this operator will depend on the execution of the first command. |
<aside> 💡 Read more about command line chaining here:
</aside>