kr6sqg
Last Updated: February 25, 2016
·
2.179K
· dotcode
0abba8c023667a16e939e2d6ada9eb5a

Compress the cd, ls -la series of commands

Don't bother typing "cd foo; ls -la" - instead add this to your startup script of preference and just do it in one:

function cl () {
   if [ $# = 0 ]; then
      cd && ls -la
   else
      cd "$*" && ls -la
   fi
}

Usage: cl [path]

Say Thanks
Respond

4 Responses
Add your response

1394
4b1d6b35af544f010943e8c15bbb3ec8
over 1 year ago ·
5715
4964bad1252f34c95f18c0862edb5c23

For me it's very annoying.
Whats happens when you go to directory with 10k files? ;)

over 1 year ago ·
5776

That and the following are my favorite bash functions:

mcd() { mkdir -p "$@" && cd $_; }

This creates a new directory (if it does not exist) and cd's to it.

over 1 year ago ·
13906
019d3856aef13b5ce37175b5edfc249d

I have configured ZSH like this: 'foo; l', which means 'cd foo; ls -l'

over 1 year ago ·