#bash

32 solutions

Fail Fast in Bash With set -euo pipefail
macOSbashshellscripting

Add a strict-mode header so scripts stop on unset variables and failing pipes.

Low risk ✓ 2026-10-13
Create permanent bash aliases
Linuxbashalias

Make short commands like ll or backup run your long ones in every new terminal.

Low risk ✓ 2026-09-18
Clear your bash command history
Linuxbashprivacysecurity

Wipe the current session's history and the saved history file.

High risk ✓ 2026-09-18
Lint Shell Scripts with ShellCheck
Linuxlintingbashshellcheck

Static-analyze bash and sh scripts for the quoting bugs, unhandled expansions, and portability traps that cause 3 a.m. incidents.

Low risk ✓ 2026-09-17
Show Timestamps in Bash History (HISTTIMEFORMAT)
Linuxbashshellcli

Make `history` print the date and time each command was executed by setting the HISTTIMEFORMAT variable in your shell config.

Low risk ✓ 2026-09-18
Compare Command Output With Process Substitution
macOSbashautomationshell

Feed the output of two commands directly into diff or other file readers.

Low risk ✓ 2026-10-13
Create safe temporary files with mktemp
LinuxbashFilesscripts

Replace predictable /tmp filenames with collision-proof, permission-safe temp paths in scripts.

Low risk ✓ 2026-09-19
Write Multi-Line Files With Here-Documents
macOSbashshellscripting

Embed configuration or scripts inline using <<'EOF' blocks.

Low risk ✓ 2026-10-13
Prevent Overlapping Runs With flock
macOSbashautomationshell

Take a file lock so a cron job cannot start while the previous run is active.

Low risk ✓ 2026-10-13
Bulk Create Paths With Brace Expansion
macOSbashautomationshell

Generate many names at once with {a,b} lists and {1..5} ranges.

Low risk ✓ 2026-10-13
Clean Up Temp Files with bash trap on Exit
Linuxtrapbashshell

Register a cleanup handler that runs when your script exits normally, is interrupted with Ctrl-C, or is killed with SIGTERM.

High risk ✓ 2026-09-18
Recursive Globbing With globstar
macOSbashautomationshell

Turn on ** to match files at any depth in the current directory tree.

Low risk ✓ 2026-10-13