tty.help
Appearance

Display preferences are saved in this browser.

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.

  1. |

    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.

  2. &&

    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.

  3. ||

    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.

  4. ;

    Run the next command

    Separate commands without requiring the previous command to succeed.

  5. >

    Replace an output file

    Redirect standard output to a file. The shell can create or truncate the file before the command runs.

  6. >>

    Append to an output file

    Redirect standard output to the end of a file, creating it if needed. This still changes the file.

  7. 2>

    Redirect errors

    Redirect file descriptor 2, standard error, to a file. That file can be created or truncated.

  8. $()

    Substitute command output

    Run the command inside parentheses and substitute its output. Quoting and word splitting affect what happens next.

  9. *

    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.