2
1
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?
2
1
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?
6
Correct. Use a function instead.
c() { cd "$1" ; ls ; }
1OMG - what keywords can I use to Google on more similar stuff like this? – funk-shun – 2011-04-21T06:59:59.193
2http://tldp.org/LDP/abs/html/ – Ignacio Vazquez-Abrams – 2011-04-21T07:05:23.033