4 ms·
most people seem to use cd and ls very frequently. Very often they are used one after another. This reminds me of a trick I heard in a talk by Damian Conway:
by jsrn 18y ago
most people seem to use cd and ls very frequently. Very often they are used one after another. This reminds me of a trick I heard in a talk by Damian Conway:
alias cdd='cd $l; ls'
I can't find the original slides, here is a writeup by cromatic:
http://www.oreillynet.com/onlamp/blog/2003/07/oscon_2003_day_one.html http://www.oreillynet.com/onlamp/blog/2003/07/oscon_2003_day...
- attack 18y agoTab completion!! Why the heck not?
- breily 18y agoI did that with this: function z () { if [ $# = 0 ]; then ls -lFGh else cd "$*" && ls -lFGh fi } That way if you don't specify a directory it just does an ls. Edit: and apparently it took away my line breaks there, but it still makes sense.
- wanorris 18y agoI used to have cdl aliased to that, and lost track of it during a long sojourn in Windows. I'm still in the process of building out a really kickass bash again. Thanks for the reminder of that alias!
- __ 18y agoIt seems so obvious, and yet it took me several years before I finally made a cd-ls alias. I made a mkdir-cd alias too.