I frequently run the ls command after running the cd command. How can I create an alias (like cs) for this operation?
|
|
||||
|
|
|
From Bash Tips and Tricks: 'cd' with style:
As @geirha corretly notes, the above function will fail if you try to switch to a directory with a space in its name:
You should instead use the following function:
Once you add that code to your
|
||||
|
Use a function instead of an alias:
|
|||||
|
|
You can use the
|
|||||||||||
|
|
Thanks Florian Diesch for the tip of using a function. I can't use I added this to
The terminal needs to be |
|||||
|
|
As an expansion to this function: |
|||
|
|