Disk Space Warning Script
Copy a disk space warning bash script using df, thresholds, cron, and email alerts. Monitor Linux se...
Full guide →68 copy-paste bash scripts with plain-English explanations. ShellCheck-clean.
Copy a disk space warning bash script using df, thresholds, cron, and email alerts. Monitor Linux se...
Full guide →A deleted file on Linux has no undo. This bash backup script timestamps every cp -r run with a date...
Full guide →Guessing server state mid-outage costs time. One bash script reports hostname, uptime, CPU load, RAM...
Full guide →Opening files one by one to find a string wastes time. grep -rn searches every file under a director...
Full guide →Learning a site is down from a user complaint means the outage already cost you. A bash curl check t...
Full guide →The wrong comparison operator makes a bash if statement fail silently on unexpected input. if/else,...
Full guide →Backup folders without dates overwrite old runs and sort unpredictably. date +%Y-%m-%d names each fo...
Full guide →Disk at 100% and the server stopped. Find the biggest files and directories fast with du and find, s...
Full guide →EADDRINUSE means something already holds your port. Find the process with lsof or ss and kill it saf...
Full guide →A bash script that maps every port your server is listening on, along with the process name holding...
Full guide →A bash script that removes stopped containers, unused images, dangling volumes, and build cache from...
Full guide →A for loop over ls output splits filenames with spaces and skips files silently. Loop over a glob, r...
Full guide →Find and replace text in files with sed: in-place edits, GNU vs macOS -i, word boundaries, capture g...
Full guide →A firewall rule built on the wrong IP locks you out. Find your local, public, gateway, DNS, and MAC...
Full guide →A variable you never exported is invisible to child processes, so the deploy reads an empty token an...
Full guide →ss shows the port listening, yet other machines get Connection refused. The service is bound to 127....
Full guide →The systemd journal keeps logs until its own cap, up to 4G by default. Check it with journalctl --di...
Full guide →/bin/bash^M: bad interpreter means the script has Windows CRLF line endings. Find them with file or...
Full guide →Fix bash: command not found: check PATH, typos, a stale hash table, CRLF line endings and sudo's PAT...
Full guide →Fix bash unary operator expected errors: an empty variable inside [ ] vanishes. Quote it, switch to...
Full guide →Fix Permission denied when running a bash script: chmod +x, directory search bits, noexec mounts and...
Full guide →Copy-paste ss command examples: -tulpn, port and state filters, -s, and the netstat equivalents, wit...
Full guide →Remove all Docker containers in two commands, plus the filters, the empty-list error, what survives...
Full guide →AWK cheat sheet with run-verified one-liners: print a column, filter rows, sum a field, count by key...
Full guide →Bash while loop examples that survive production: read -r line loops, the pipe-subshell variable tra...
Full guide →Bash case statement examples with real output: glob patterns, | alternatives, why pattern order matt...
Full guide →scp command examples run for real: push, pull, -r, -p, remote paths with spaces, OpenSSH 9+ SFTP mod...
Full guide →Cron job not running? Seven checks in order: the daemon, the schedule, permissions, cron's PATH, une...
Full guide →Ubuntu 26.04 runs most coreutils from Rust (uutils) but keeps cp, mv and rm GNU. See which one each...
Full guide →status=203/EXEC means systemd could not start your program at all. The journal line names which of f...
Full guide →Unmanaged logs fill /var/log until writes fail and services crash. find -mtime deletes .log files ol...
Full guide →Bash keeps going after a failed command, so a broken cd followed by rm -rf hits the wrong directory....
Full guide →ps, grep, copy the PID, kill: four steps every time. pkill stops a process by name in one command, a...
Full guide →A world-writable file on a web server lets a compromised script overwrite your app. Audit permission...
Full guide →A runaway process at 100% CPU goes unnoticed until the server stops responding. Measure CPU and RAM...
Full guide →A monitoring script with no email alert fails silently until users notice. A reusable bash alert fun...
Full guide →A mistaken DROP TABLE has no undo. Back up MySQL nightly with mysqldump and gzip, rotate dumps older...
Full guide →Password SSH on an internet-facing server invites brute-force attempts. A bash script runs ssh-keyge...
Full guide →Duplicate files pile up in archives and downloads and waste gigabytes. md5sum hashes every file and...
Full guide →A crashed nginx or PostgreSQL stays down for hours with no watchdog. A cron script uses systemctl is...
Full guide →A local-only backup dies with the machine. Push an incremental, resumable copy to a remote server wi...
Full guide →A bash script that connects to any domain over TLS, reads the certificate, and tells you how many da...
Full guide →A while-read loop silently skips the last line of a file with no final newline. Read files line by l...
Full guide →A function reused 'target' without local, overwrote the caller's variable, and cleanup deleted the w...
Full guide →return in a bash function sets an exit code, not a string. Return data with echo and command substit...
Full guide →A list stored as a space-separated string splits once an item has a space. Bash arrays fix it: index...
Full guide →A script that reads $1 as a value takes --env as that value and deploys nowhere. Parse arguments wit...
Full guide →cut -d/ -f3 returns the wrong slice once a URL gains https. Bash parameter expansion: substrings, pr...
Full guide →A long cron job overlaps its next run and stacks copies until the box falls over. flock locks it to...
Full guide →A hung cron job never exits, never frees its lock, and quietly stops the job running. Bound a comman...
Full guide →A deploy that dies on the first transient error costs a night of manual re-runs. Retry with exponent...
Full guide →Plain curl exits 0 on an HTTP 500 and poisons everything downstream. A bash curl wrapper that checks...
Full guide →Read fields from a JSON API response with jq, and the three things (-r, // defaults, -e) that keep t...
Full guide →Post failure alerts to Slack from bash with curl, a jq-built payload and an ERR trap, so a broken ba...
Full guide →A script that dies mid-run leaves temp files and half-written output behind. trap on EXIT with mktem...
Full guide →An ssh loop that ignores exit codes reports done while three hosts never changed. Run one command or...
Full guide →A bash script that snapshots every listening TCP and UDP socket as CSV, diffs it against the previou...
Full guide →A cron bash watchdog for systemd units: restarts a stopped service, probes a hung one, bounds start-...
Full guide →A logrotate alternative for directories it does not own: keep the newest N dated folders, delete the...
Full guide →Every script re-invents strict mode, ERR traps, temp cleanup and a lock, or forgets one. Source ten...
Full guide →Writes fail with No space left on device while df -h shows free space: the filesystem is out of inod...
Full guide →rm *.log fails with Argument list too long and deletes nothing: the glob outgrew ARG_MAX. Use find -...
Full guide →lsof examples for three real jobs: which process holds a port, who has a file or directory open, and...
Full guide →Bash heredoc explained with real runs: quoted vs unquoted EOF and what expands, <<- and the tabs-onl...
Full guide →Ubuntu 26.04's sudo-rs drops sudoers rules with wildcards in arguments, then denies the command. See...
Full guide →sudo-rs on Ubuntu 26.04 says I'm afraid I can't do that for a missing rule, a dropped rule or one wr...
Full guide →Ubuntu 26.04's Rust coreutils change timeout's exit code, error text and edge cases scripts rely on....
Full guide →Start request repeated too quickly means systemd stopped restarting a crashing service. Find the err...
Full guide →Free Interactive Tools
Need a cron expression? chmod calculator?
14 browser-based bash tools — no install required
An operational script system + a 30-function shared library + a 52-page field guide. The production layer the free snippets don't cover.
Get the Toolkit →