explaingit

idnan/bash-guide

12,273Audience · developerComplexity · 1/5Setup · easy

TLDR

A cheat-sheet reference guide for the Bash shell covering file operations, text manipulation, scripting, and debugging with syntax examples and real output.

Mindmap

mindmap
  root((bash-guide))
    Basic Operations
      File operations
      Text operations
      Directory navigation
      SSH and networking
    Shell Scripting
      Variables and arrays
      Functions
      Loops and conditionals
      Pipes and regex
    Advanced Topics
      Debugging scripts
      Parallel execution
      Shell tricks
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Look up the exact syntax for a file or text command without memorizing it

USE CASE 2

Write Bash scripts with variables, loops, and functions using copy-paste working examples

USE CASE 3

Learn shell tricks and shortcuts to speed up daily terminal work on Linux or macOS

Tech stack

BashShell

Getting it running

Difficulty · easy Time to first run · 5min

In plain English

This repository is a practical reference guide for the Bash shell, a command-line interface used on Linux, macOS, and similar operating systems. It is written as a cheat-sheet-style document: each section covers a category of commands, each with a brief description, the syntax, and a working example showing what the output looks like. The guide is divided into five main areas. The first covers basic operations, grouped into sub-sections for file operations (commands like copying, moving, deleting, and compressing files), text operations (searching and transforming text content), directory operations (creating folders, navigating paths), SSH and networking (connecting to remote machines, checking network status), and process monitoring (seeing what programs are running and managing them). The second area covers shell programming: writing scripts that do more than run individual commands. This includes storing values in variables, working with lists of items called arrays, manipulating strings, writing reusable functions, making decisions with conditionals (if/then logic), looping over data, using regular expressions to match patterns in text, and connecting commands together using pipes so the output of one command becomes the input of the next. The remaining sections cover shell tricks (shortcuts and less-obvious features), debugging techniques for finding problems in scripts, and multi-threading (running multiple operations in parallel). The guide targets beginners and people who use the terminal occasionally and need a quick reminder of how a specific command works, rather than those wanting a deep explanation of internals. The full README is longer than what was shown.

Copy-paste prompts

Prompt 1
Using patterns from the bash-guide, write me a Bash script that loops over all .csv files in a folder and prints the second column of each line
Prompt 2
How do I use pipes and grep together to search for a pattern across multiple files, as shown in the bash-guide?
Prompt 3
Write me a Bash function with error handling that accepts arguments and returns a non-zero exit code on failure, following the bash-guide style
Prompt 4
How do I run three Bash commands in parallel and wait for all of them to finish before continuing?
Prompt 5
Show me how to use a regular expression in Bash to validate that a variable looks like an email address
Open on GitHub → Explain another repo

← idnan on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.