Environment & Shell Customization (Aliases/Functions/.Bashrc)
Stop polluting your bash history with every single mistake
🧩 The Challenge
Everyone keeps a bash history, but it usually becomes a disaster zone filled with typoed passwords, repeated ls commands, and commands you hit by accident. Finding that one complex firewall rule you ran six months ago is impossible when the history file is 90% garbage.
💡 The Fix
You can actually tweak your shell environment to ignore duplicate entries and those annoying single-space prefixed commands that clutter up your logs. It cleans house automatically so your history stays readable.
export HISTCONTROL=ignoreboth:erasedups
export HISTSIZE=10000
export HISTFILESIZE=20000
shopt -s histappend
⚙️ Why It Works
Setting ignoreboth tells bash to skip commands starting with a space and duplicates, while erasedups scrubs the existing history file of any old versions of the same command. It’s an instant quality-of-life upgrade for anyone who spends their day in a terminal.
🚀 Pro-Tip: Prefix a command with a space before hitting enter to keep it out of your history entirely.
Linux Tips & Tricks | © ngelinux.com | 7/22/2026
