Ready-to-use Linux scripts

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.

Before you run any script from the internet
  • Read it. The scripts here are kept short so this is realistic.
  • Run it once with a dry-run flag or on a non-production target where the script supports it.
  • Back up anything you are not willing to lose — especially before destructive operations.
  • If a script asks for sudo, understand which step needs it and why.

System administration

Disk and files

FilesBulk operations

Bulk-rename files safely

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.

Read script →

Security and ops

How these scripts are written

  • Plain shell where possible. Most scripts target /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.
  • Defaults are conservative. Destructive flags (--delete on rsync, recursive removes) require an explicit opt-in.
  • No third-party dependencies. Each script uses only tools that ship in the base install of the major distributions.
  • One file, no install step. Save the script to disk, chmod +x, run it.

Related reading