Skip to main content

Menu

LEVEL 0
0/5 XP
HomeAboutTopicsPricingMy VaultStats

Categories

🤖 Artificial Intelligence
☁️ Cloud and Infrastructure
💾 Data and Databases
💼 Professional Skills
🎯 Programming and Development
🔒 Security and Networking
📚 Specialized Topics
HomeAboutTopicsPricingMy VaultStats
LEVEL 0
0/5 XP
GitHub
© 2026 CheatGrid™. All rights reserved.
Privacy PolicyTerms of UseAboutContact

Linux – Bash Cheat Sheet

Linux – Bash Cheat Sheet

Back to Operating Systems and CLI
Updated 2026-04-27
Next Topic: Linux Bash Scripting Cheat Sheet

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 NavigationTable 2: File OperationsTable 3: File Viewing and EditingTable 4: Text Processing and FilteringTable 5: File Permissions and OwnershipTable 6: Archiving and CompressionTable 7: Process ManagementTable 8: System InformationTable 9: NetworkingTable 10: User and Group ManagementTable 11: Package Management (Debian/Ubuntu)Table 12: Package Management (RPM / Arch / openSUSE)Table 13: Redirection and PipesTable 14: Control Flow and ConditionalsTable 15: LoopsTable 16: Variables and EnvironmentTable 17: Parameter ExpansionTable 18: ArraysTable 19: FunctionsTable 20: Command Substitution and EvaluationTable 21: Process SubstitutionTable 22: Test Operators (Files)Table 23: Test Operators (Strings)Table 24: Test Operators (Arithmetic)Table 25: Arithmetic OperationsTable 26: Quoting and EscapingTable 27: Globbing and Pattern MatchingTable 28: Script Best PracticesTable 29: History and Command Line EditingTable 30: Debugging and Error HandlingTable 31: Input/Output Builtins (read, printf, getopts)Table 32: Special Bash VariablesTable 33: Systemd Service Management

Table 1: File and Directory Navigation

CommandExampleDescription
ls
ls -lah
• Lists files and directories
• -l long format, -a hidden files, -h human-readable sizes.
cd
cd /etc
cd ~
• Changes directory
• ~ expands to home, - to previous directory.
pwd
pwd
Prints the current working directory absolute path.
find
find . -name "*.log"
Searches for files matching criteria recursively from specified path.
tree
tree -L 2
• Displays directory structure recursively
• -L limits depth.
locate
locate config.txt
• Fast file search using pre-built database
• run updatedb to refresh.

More in Operating Systems and CLI

  • jq Command-Line JSON Processor Cheat Sheet
  • Linux Bash Scripting Cheat Sheet
  • AWS CLI Cheat Sheet
  • iptables Legacy Linux Firewall Reference Cheat Sheet
  • nftables Modern Linux Firewall Cheat Sheet
  • tar gzip zip Archive and Compression Tools Cheat Sheet
View all 51 topics in Operating Systems and CLI