Skip to content
$bash-guides

Bash Guides

Snippets and guides solve different problems. A snippet is one task and one script: check disk space, kill a process on a port, dump a database. You land on it from a search, copy the script, schedule it, and move on. A guide is the layer above that — an end-to-end workflow that composes several scripts into a system, with the judgment about which to run, in what order, and why. Snippets answer “how do I do X”; guides answer “what should I actually run on a production server, and how do these pieces fit together.”

Guides are for the moment you have outgrown copy-paste. You have a server that matters, a handful of scripts already on cron, and the questions have shifted: which checks do I actually need, how do detection and alerting and recovery connect, what does a sane baseline look like for a box I just provisioned. The individual snippet pages cannot answer that — each describes one tool in isolation. A guide is where the cross-cutting decisions live.

Every guide here is built from scripts you can also find as standalone snippets, so nothing is locked behind the long-form. The guide adds the sequencing and the reasoning; the snippets stay the reference you return to when you need just the command.

Start here

New to the site? Begin with 25 Bash Scripts Every Linux Sysadmin Needs. It is the widest-coverage guide here — a single pass that hardens a fresh server against the four failures that take production down most often, with every script ready to copy and schedule.

pillar guide · sysadmin

25 Bash Scripts Every Linux Sysadmin Needs

The 25 bash scripts that prevent the most common server failures — disk full, SSL expiry, failed services, insecure permissions. Copy-paste ready, cron-schedulable, no installs required.

You walk away with a provisioning checklist, not a reading list: the exact scripts that prevent a disk-full outage, a silent SSL expiry, a service that died over the weekend, and a permission hole on a fresh web root. It is organized by failure mode, so you can jump straight to the problem you are trying to prevent and leave with the cron entry that prevents it.

Read guide →
pillar guide · sysadmin

Bash Scripting for CI/CD Pipelines: GitHub Actions, Deploys, and Docker

A pipeline reported every step green and deployed broken code, because the build step piped output through tee and bash returned the exit code of tee — always zero. This guide covers the four CI-specific failure modes, safe bash headers, secret validation, PIPESTATUS and pipefail, Docker entrypoints, atomic symlink deploys, and debugging with set -x.

You leave with a deploy script that fails loudly, rolls back automatically, and passes a health check before marking success — not one that ships broken builds under a green checkmark.

Read guide →
pillar guide · sysadmin

Bash Text Processing: find, grep, sed, and awk for Logs and Config Files

The four commands that turn an unreadable log or a tree of config files into an answer — find to locate, grep to search, sed to transform, awk to summarize. The order matters, and the gotchas are the reason most one-liners do the wrong thing quietly.

You leave with the pipeline order that keeps text processing boring: scope the blast radius with find, confirm the match with grep, transform with sed or awk under an undo, and verify before you trust it — plus the 2am incident one-liner that ranks your errors most-frequent-first.

Read guide →
pillar guide · sysadmin

Bash Scripts That Survive Cron: Locking, Timeouts, and Retries

A script that works when you run it isn't the same as one that survives unattended on cron. The three ways cron jobs die quietly — overlap, hang, transient failure — and the guards that stop each one.

The three ways cron jobs die quietly — overlap, hang, transient failure — and the guard that stops each.

Read guide →