Stop bash from treating your typos like catastrophes
Environment & Shell Customization (Aliases/Functions/.Bashrc)
Stop bash from treating your typos like catastrophes
🧩 The Challenge
Everyone has had that moment where they accidentally fat-finger a command like sl instead of ls and then stare at a command not found error for ten seconds wondering what they did wrong. It sounds petty, but when you are mid-troubleshooting and your brain is already fried, that little bit of friction is enough to make you want to throw your keyboard out the window.
💡 The Fix
You can tell your shell to quietly auto-correct your directory changes or common typos before it even bothers telling you there is a problem. It saves a few seconds of frustration and keeps your workflow moving without those annoying interruptions.
shopt -s cdspell
shopt -s dirspell
⚙️ Why It Works
These settings enable a built-in bash feature that checks your command history and directory structures for minor character swaps or missing letters. Once enabled, the shell just fixes the path automatically instead of complaining to you about a non-existent folder.
🚀 Pro-Tip: Toss these into your .bashrc and you will stop hitting the backspace key so much.
Linux Tips & Tricks | © ngelinux.com | 7/30/2026
