Update any Linux system from one script
Detect the distribution family and run the right update commands — apt, dnf, pacman or zypper. Useful when you maintain a mix of machines.
A small, hand-edited collection of shell scripts for tasks that come up over and over. Copy, paste, read first, run. Last reviewed on 2026-05-13.
Each page in this section is built around a single script that solves one well-defined problem. The scripts are written in plain POSIX shell or Bash, depend only on tools that ship with the distribution, and are short enough to read end-to-end before you run them. There is no curl | sudo bash install ritual; every script is meant to live in a file you control.
sudo, understand which step needs it and why.Detect the distribution family and run the right update commands — apt, dnf, pacman or zypper. Useful when you maintain a mix of machines.
A safe rsync backup script with snapshot-style rotation, sensible excludes and a dry-run mode. The one to drop into cron or a systemd timer.
The reference page for "where did my disk go?" Five reliable patterns with du, find and ncdu, plus a script that prints the top 50 offenders.
Three approaches to renaming many files at once — pure shell, the rename utility and mmv — with a dry-run pattern that catches mistakes before they happen.
A small script that reads a list of domains and reports how many days are left on each certificate. Send the output to email or a monitoring system.
Read script →/bin/sh and a POSIX subset. Where Bash-only features are useful, the shebang is #!/usr/bin/env bash.set -euo pipefail in Bash scripts. Stops on the first error, treats unset variables as an error and propagates failures through pipes. Catches more bugs than it costs.--delete on rsync, recursive removes) require an explicit opt-in.chmod +x, run it.chmod +x step and a few of the more subtle access-related failures.