The little symbols doing big things · 9 operators
Read between the commands.
Your shell interprets these symbols. They can move data, change files, or decide what runs next.
|Pass output along
Connect standard output of the left command to standard input of the right. Standard error is separate unless redirected. A pipeline can still contain destructive commands.
&&Continue on success
Run the right command only if the left command exits with status zero. Zero means success by that program’s convention, not that the action was safe.
||Continue on failure
Run the right command when the left exits nonzero. A nonzero status can have a special meaning, such as grep finding no matches.
;Run the next command
Separate commands without requiring the previous command to succeed.
>Replace an output file
Redirect standard output to a file. The shell can create or truncate the file before the command runs.
>>Append to an output file
Redirect standard output to the end of a file, creating it if needed. This still changes the file.
2>Redirect errors
Redirect file descriptor 2, standard error, to a file. That file can be created or truncated.
$()Substitute command output
Run the command inside parentheses and substitute its output. Quoting and word splitting affect what happens next.
*Expand a pattern
The shell can expand an unquoted wildcard into matching filenames before the program starts. Behavior for no matches varies by shell settings.
Examples assume common Unix-like shell conventions. Quoting and dialect matter. Consult the Bash manual.