Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
Where are you typing gl? The terminal? The GUI? – Thomas Ward Mar 26 '13 at 2:58
Nobody ever addressed the original why? question. I can confirm that aliases defined in .profile do not work in any context I tried: text console logins, graphical terminals, or anything else, even though enviromental variables from the same file do work. – Daniel Mahler Apr 6 at 5:57
up vote 2 down vote accepted

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 .allias or whatever and add .allias to your .bashrc

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

share|improve this answer
As for the formatting askubuntu uses markdown. Please check out for the details. – saji89 Mar 26 '13 at 4:23
Why does .bashrc work while .profile doesn't? Also, any reason why you chose to name the alias file .allias rather than .alias? – Tom Apr 4 '15 at 22:59

If you are using bash (echo $SHELL) as a shell interpreter I think it is best (or maybe the only way) if you define your own CD function.

Edit your .bashrc file and add the following at the end:

# my custom functions:
function gl () {
   cd /home/jrenner/glances/glances/

You could also extend it like so:

# my custom functions:
function cdw () {
   cd /home/jrenner/glances/glances/$1

and change directly to a sub directory and list it's contents.

share|improve this answer
That may be a fine suggestion, but it is not an answer, as it doesn't explain why the alias directive placed in the .profile file fails. – Tom Apr 4 '15 at 22:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.