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?

link|improve this question

feedback

1 Answer

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.

link|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
feedback

Your Answer

 
or
required, but never shown

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