Site icon New Generation Enterprise Linux

Quit typing the same long path over and over when you edit configs

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

Quit typing the same long path over and over when you edit configs

đź§© The Challenge

Dealing with a deep directory tree like /etc/nginx/conf.d or /var/log/app/current is a massive waste of keystrokes. I’ve spent way too much time fat-fingering paths in the terminal during an outage.

đź’ˇ The Fix

Use a shell function to create a bookmark-like alias that cd’s you directly to your hot-zone. It saves you from muscle memory errors when you’re under pressure.

cdpath() { cd "/etc/nginx/sites-available/$1" ; }
alias logme='cd /var/log/supervisor/shared-services/active'

⚙️ Why It Works

Adding these to your .bashrc creates custom shortcuts that drop you exactly where you need to be in a single command. Bash executes these functions as if you’d typed the full path out by hand.

🚀 Pro-Tip: Store your commonly used paths in a text file and grep them if you ever forget your custom shortcuts.

Linux Tips & Tricks | © ngelinux.com | 11/29/2026

0 0 votes
Article Rating
Exit mobile version