Bash (Bourne Again SHell) is the default command-line shell on most Linux distributions and macOS, combining the power of the original Bourne shell with modern scripting features. Understanding Bash is essential for system administration, automation, DevOps workflows, and efficient file and process management. While many know basic commands like ls and cd, Bash's true power lies in its scripting capabilities, parameter expansion, process substitution, and text processing tools—features that turn repetitive manual tasks into elegant one-liners. The key mental model: everything in Bash is text, which means pipes, redirection, and command substitution form the backbone of composable, reusable solutions. As of 2025, Bash 5.3 is the current release, adding subshell-free command substitution and other improvements.
What This Cheat Sheet Covers
This topic spans 33 focused tables and 366 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
Table 1: File and Directory Navigation
| Command | Example | Description |
|---|---|---|
ls -lah | • Lists files and directories • -l long format, -a hidden files, -h human-readable sizes. | |
cd /etccd ~ | • Changes directory • ~ expands to home, - to previous directory. | |
pwd | Prints the current working directory absolute path. | |
find . -name "*.log" | Searches for files matching criteria recursively from specified path. | |
tree -L 2 | • Displays directory structure recursively • -L limits depth. | |
locate config.txt | • Fast file search using pre-built database • run updatedb to refresh. |