Operators
The Command Operators allow users to control the flow of commands and processes in the terminal, offering greater flexibility and efficiency. Here is an explanation of their use:
Execute a command and send it to the background
$command &
Execute a list of commands
$command1 && $command2
$command1 ; $command2
Redirects the output of a command to a file
$command > $filename
Redirects the output of a command to a file, but it appends it to the final instead of overwriting it
$command >> $filename
Takes content from a file
$command < $filename
Takes content from a stream
$command << $stream #Ex: cat << EOF
Pass the result of a command as a parameter to another command
$command1 | $command2
Catch an error in a file
$command1 2>$filename
Last updated