Home » Linux Control Operators

Linux Control Operators

by Online Tutorials Library

Linux Control Operators

With the help of control operators you can put more than one command in the command line. It helps in performing a control function.


Use of control operators

Backslash enables control character but without shell interpretation.

Control Operator Usage
;semicolon More than one command can be used in a singleline.
& ampersand Command ends with & and doesn’t wait for command to finish.
$?dollar question mark Used to store exit code of the previous command.
&& double ampersand Used as logical AND.
|| double vertical bar Used as logical OR.
Combining && and || Used to write if then else structure in command line.
# pound sign Anything written after # will be ignored.
escaping special characters

You may also like