Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

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.

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
add comment

Your Answer

 
discard

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.