Environment & Shell Customization (Aliases/Functions/.Bashrc)
Stop hitting tab until your fingers bleed in complex paths
đź§© The Challenge
You know that feeling when you’re three levels deep in a project directory and have to hop into a sub-folder that’s buried in another deeply nested set of directories? Constantly typing out full paths or spamming cd ../../.. is a fast track to RSI and absolute annoyance.
đź’ˇ The Fix
Just add a directory stack function to your profile so you can jump back to previous locations without thinking. It turns navigation into a simple stack operation that saves your sanity during messy debugging sessions.
pushd () { command pushd "$@" > /dev/null; dirs; }
popd () { command popd "$@" > /dev/null; dirs; }
alias d='dirs -v'
⚙️ Why It Works
By wrapping pushd and popd, you get an automatic printout of your directory stack every time you switch contexts. The alias lets you see your last ten locations instantly with a single letter, so you can jump back by index rather than typing paths.
🚀 Pro-Tip: Use cd – to hop back and forth between only the last two directories if you’re too lazy to set up a full stack.
Linux Tips & Tricks | © ngelinux.com | 11/12/2026
