Site icon New Generation Enterprise Linux

Stop typing full paths when you work across multiple environments

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

Stop typing full paths when you work across multiple environments

đź§© The Challenge

You ever spend all day jumping between staging and production, only to find yourself typing /var/www/my-project/config/settings.yaml over and over again? It’s a complete waste of keystrokes and eventually you’re going to accidentally edit the wrong file because you’re tired of typing the path.

đź’ˇ The Fix

Just use a shell variable to store your base directory and you can reference it instantly without needing to remember where the symlink is hidden. It saves my fingers and my sanity on deployment days.

export PROJ_DIR=/var/www/project-alpha-v2
cd $PROJ_DIR/config

⚙️ Why It Works

Setting this in your .bashrc makes the variable available the moment you open a new terminal tab. Since it is just a standard environment variable, you can use it in your scripts or just prefix your paths to jump straight to the source.

🚀 Pro-Tip: If you change projects often, throw an alias in your bashrc that quickly swaps the path variable to point at your new working directory.

Linux Tips & Tricks | © ngelinux.com | 10/1/2026

0 0 votes
Article Rating
Exit mobile version