Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

What happens if I have this in my bashrc:

alias ls="ls -l"
alias ls="ls -a"

when I type ls they will both match. Is the last one kept or both?

share|improve this question
up vote 6 down vote accepted

The second alias command will redefine the alias for "ls". You can double check by running the alias command with no arguments, to see which aliases are defined.

share|improve this answer
+1 Right answer. No overloading with the alias command. – Satanicpuppy Mar 8 '10 at 21:35
Or better yet, alias ls will show you what (if anything) ls specifically is aliased too. – Matthew Flaschen Mar 8 '10 at 22:18

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.