How do I create an alias c that will cd and then immediately ls?

alias c='cd; ls'

Is there some kind of way to insert a special variable that represents the input? Or is that not the way that alias operates at all?

link|improve this question

73% accept rate
feedback

1 Answer

up vote 5 down vote accepted

Correct. Use a function instead.

c() { cd "$1" ; ls ; }
link|improve this answer
OMG - what keywords can I use to Google on more similar stuff like this? – funk-shun Apr 21 '11 at 6:59
1  
feedback

Your Answer

 
or
required, but never shown

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