Bash – Why Setting Alias in .profile is Not Working

aliasbashcommand lineprofile

I have this as the last line in my .profile:

alias gl="cd /home/jrenner/glances/glances"

yet even after reboot I get command not found when typing gl. What is happening? I am logged in as the correct user.

Best Answer

I'm pretty sure that lpanebr's idea will work, but here's a more elegant solution. Do that alias command in .bashrc That's how I do it, or some people prefer to add a file dedicated to alias. Call it .alias or whatever and add .alias to your .bashrc

Wish I could do formatting like @lpanelbr. I wonder if there is a wiki?