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

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?

share|improve this question
up vote 5 down vote accepted

Correct. Use a function instead.

c() { cd "$1" ; ls ; }
share|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

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.