Stop mangling your paths when jumping between projects

Environment & Shell Customization (Aliases/Functions/.Bashrc)

Stop mangling your paths when jumping between projects

🧩 The Challenge

You’ve got five different project folders deep in your home directory, and typing that full path every time you switch is driving you insane. I’ve wasted so many minutes just hitting tab until my fingers hurt, only to end up in the wrong sub-directory anyway.

💡 The Fix

Just add a directory stack function to your profile so you can jump back and forth with a single short command. It’s a total game changer for anyone bouncing between logs, configs, and source code.

pushd_cd() {
pushd "$1" > /dev/null
}
alias back='popd > /dev/null'
alias jump='pushd_cd'

⚙️ Why It Works

Using pushd and popd creates a virtual stack of your visited directories, letting the shell remember exactly where you were. These aliases just clean up the output so you don’t have to see the path list printed every single time you navigate.

🚀 Pro-Tip: Add a bind command to your .inputrc to cycle through your history with the arrow keys.

Linux Tips & Tricks | © ngelinux.com | 8/28/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted