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

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

You must log in to answer this question.

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