Super User is a question and answer site for computer enthusiasts and power users. 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'm new to bash and unix. I'm trying to create an alias for ls. In my .bash_profile I have the following:

alias ls="ls -lhHG"

This doesn't work at all. If I change it to:

alias la="ls -lhHG"

then everything but G (showing pretty colors) works.

Right now my $Path is


The only other stuff in my .bash_profile is

1 export EDITOR=/usr/bin/vim
2 export PATH=/opt/local/bin:~/bin:$PATH

Again, I'm totally new to this so please go easy on me.

share|improve this question
I'm not sure what you mean by 'doesn't work'. what are you seeing, and what do you want to happen. Also, what platform? Linux, OSX? It is significant what flags to pass to ls to 'work' – Rich Homolka Oct 5 '10 at 23:13
By doesn't work I mean when I try to run the command ls it just runs the ls command with no additional options. The platform is OSX. – clang1234 Oct 6 '10 at 4:09
up vote 2 down vote accepted

After you edit .bash_profile, make sure you source it into your current environment with:

source ~/.bash_profile


. .bash_profile

Then, your new modified commands should be available to you.

share|improve this answer
Thanks! I'm away from my mac atm but when I get in tomorrow I'll try this first thing – clang1234 Oct 6 '10 at 4:10
That did it. Thanks so much. Now I'm off to learn vim... I have a feeling I'll be back soon – clang1234 Oct 6 '10 at 14:54
@clang : That's why we're here ;) – Stefan Lasiewski Oct 6 '10 at 17:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .