Fifteen Terminal Habits That Compound

Updated 2026-04-06|SPUNK13 LLC|spunk.bet

Each of these is small on its own. Together they change how much of your day is spent typing paths and re-running things you already ran.

Search and Navigation

1. Use ripgrep, not grep -r. rg respects .gitignore by default, searches in parallel, and skips binaries. rg -i pattern for case-insensitive, rg -t py pattern to restrict by file type, rg -l pattern for filenames only, rg -A3 -B3 for context. Add --hidden -u when you specifically want ignored files.

2. Install fzf and bind it. Once fzf's key bindings are sourced, Ctrl+R becomes fuzzy history search, Ctrl+T inserts a fuzzy-found file path into the current command, and Alt+C fuzzy-cd's into a subdirectory. Piping anything into fzf gives you an interactive picker: git branch | fzf | xargs git checkout.

3. Replace cd with zoxide. It learns the directories you visit; z proj jumps to the most-used path matching "proj" regardless of where you are.

4. Learn cd -. Returns to the previous directory. Trivial, and used constantly once it is in your fingers.

History and Command Reuse

5. !$ is the last argument of the previous command. mkdir -p a/b/c then cd !$. Alt+. does the same interactively and cycles through earlier commands' last arguments.

6. !! reruns the last command. Its real use is sudo !! after a permission error.

7. ^old^new reruns the last command with one substitution — faster than arrow-up and editing for a single typo.

8. Fix your history settings. In bash: HISTSIZE=100000, HISTFILESIZE=200000, HISTCONTROL=ignoreboth:erasedups, and shopt -s histappend so concurrent shells do not overwrite each other's history.

Processing and Piping

9. xargs with parallelism. find . -name '*.png' -print0 | xargs -0 -P 8 -n 1 optipng runs eight at once. Always pair -print0 with -0 so filenames containing spaces do not split.

10. Learn four jq expressions. jq '.' to pretty-print, jq -r '.items[].name' for raw strings, jq 'select(.status=="error")' to filter, and jq -s 'group_by(.level) | map({level: .[0].level, n: length})' to aggregate. That covers most log and API work.

11. Use <() process substitution. diff <(sort a.txt) <(sort b.txt) compares two command outputs without temp files.

12. Know when to reach for awk. awk '{s+=$3} END {print s}' sums a column; awk -F: '$3 >= 1000 {print $1}' /etc/passwd filters on a field. Two patterns cover most of it, and both are faster than writing a script.

Sessions and Safety

13. Run long jobs inside tmux. tmux new -s deploy, detach with Ctrl+B d, reattach with tmux attach -t deploy. A dropped SSH connection stops being an incident. For a job already running, Ctrl+Z then bg then disown -h %1 is the rescue path.

14. Make destructive commands safer. set -euo pipefail at the top of every script — without pipefail, a failing command in a pipeline is invisible. Quote every variable expansion ("$var"), and run shellcheck on anything you commit; it catches roughly every quoting bug you would otherwise ship.

15. Trailing slashes matter in rsync. rsync -av src/ dst/ copies the contents of src; rsync -av src dst/ copies the directory itself into dst. Always run with -n (dry run) first when the command deletes.

The Setup Behind All of This

Put your aliases and functions in a dotfiles repository and symlink them, so a new machine is one clone away. Keep the alias list short enough to remember — twenty you use daily beat two hundred you forget. And read man pages for the tools you use most: man rsync and man find both contain more useful behaviour than any tips list, including this one.

Part of the SPUNK13 network

Visit spunk.bet400+ Free ToolsFree Casino
Dev ToolsCasinoMemesPredictionsNFT ArtOrdinalsEbooksAdvertise