All cheat sheets

Tooling

Shell & bash cheat sheet

Practical shell commands for navigating, searching and transforming text, plus the parameter expansion and redirection syntax that makes scripts shorter.

Files

Text

Pipes

Variables

Safety

Things worth remembering

  • Always quote "$var". Unquoted expansion splits on spaces and breaks on filenames with spaces.
  • set -euo pipefail at the top of a script turns silent failures into loud ones.
  • Use find ... -print0 | xargs -0 so filenames with spaces survive the pipe.

More Tooling sheets