Environment & Shell Customization (Aliases/Functions/.Bashrc)
Stop running the wrong command because your history is a mess
🧩 The Challenge
You know that feeling when you run ‘history’, only to find a wall of typos, duplicate ‘ls’ commands, and sensitive tokens you forgot to strip out? It makes finding that one complex find command you ran last week a total nightmare.
💡 The Fix
Just tweak your shell environment to ignore the junk and keep your history clean by default. It’ll save your sanity when you actually need to find a past command.
export HISTCONTROL=ignoreboth:erasedups
export HISTIGNORE='ls:ll:cd:history:exit:clear'
⚙️ Why It Works
Setting ignoreboth handles the leading space trick to skip history, while erasedups keeps the file from getting bloated with repeats. HISTIGNORE is the real hero here because it filters out the repetitive noise you type dozens of times a day.
🚀 Pro-Tip: Append these to your .bashrc and run source ~/.bashrc immediately to see the difference.
Linux Tips & Tricks | © ngelinux.com | 9/23/2026
