Site icon New Generation Enterprise Linux

Stop typing full file paths when you are already deep in the directory

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

Stop typing full file paths when you are already deep in the directory

đź§© The Challenge

You are bouncing between a deep app configuration path and a logs directory, and every time you need to edit a file, you’re typing out five levels of nesting. It’s mind-numbing work that kills your flow.

đź’ˇ The Fix

Create a shell function that aliases the current directory path to a variable so you can instantly jump back or reference files from there. This keeps your command line clean and saves your pinky finger from holding shift for forward slashes.

mark() { export TARGET=$(pwd); }
jump() { cd "$TARGET"; }

⚙️ Why It Works

Setting an environment variable like this keeps the path resident in your current shell session until you close the window or manually clear it. Since it’s just a standard shell variable, it’s lightning-fast and works exactly like a bookmark.

🚀 Pro-Tip: Put these in your .bashrc and name them something even shorter if you really want to shave off milliseconds.

Linux Tips & Tricks | © ngelinux.com | 7/27/2026

0 0 votes
Article Rating
Exit mobile version