How do I create BASH alias for:
I type in cdd directory and what that does is cd directory and then ls?
|
It'd be easier to make a function:
Of course, you can name the function whatever you like. Put it in your .bashrc or .profile or whatever it is on your system. |
|||||||||||
|
|
You want to use a function that you'll put in your
Once you put this in your appropriate file, you can use |
|||||
|
|
Just like the other function examples, but this one will work with directories with spaces, without needing to escape the spaces.
|
|||
|
|
I bet you really want to make directory be an argument, i.e. $1. can't do that with aliases. I hope that helps. |
|||
|
|
|
I think here is your answer. you can add this function to your .bashrc file:
|
|||
|
|
ls directoryinstead? – user unknown Jan 13 '12 at 7:20