Stop mistyping long directory paths for good
Environment & Shell Customization (Aliases/Functions/.Bashrc)
Stop mistyping long directory paths for good
🧩 The Challenge
Dealing with those nesting-doll application paths like /var/lib/docker/volumes/my-app-data/_data/logs/archive is the quickest way to develop carpal tunnel. I’ve wasted way too much of my life hitting the tab key only to have the shell complain about ambiguous matches.
💡 The Fix
Use a shell function to create a bookmark system that lets you jump to deep directories by typing a short, mnemonic shortcut. It saves your hands and stops you from playing “guess the path” when you are already stressed out.
j() { case $1 in app) cd /var/lib/docker/volumes/my-app-data/_data/logs/archive ;; conf) cd /etc/nginx/sites-enabled/ ;; *) cd ~ ;; esac; }
⚙️ Why It Works
Adding a case statement to a function in your .bashrc creates a lightweight navigation engine that is way faster than messing with symlinks everywhere. The shell reads this immediately upon login, so you never have to remember where you hid those obscure config files again.
🚀 Pro-Tip: Stick this in your bashrc and use cd – to jump back to where you were before you took the shortcut.
Linux Tips & Tricks | © ngelinux.com | 7/20/2026
