Tuesday, 11 May 2010

Bash: mkcd - mkdir and cd

I found the useful hint here to create a new bash command which both recursively creates a directory and changes into that directory. Just add this line to your .bashrc file.

mkcd (){ mkdir -p "$*";cd "$*";}

It supports spaces in directory names, however I do not! It is evil.

I am sure if I ever remember to use it, this will save literally tens of key strokes each day. Now that is efficiency.

No comments:

Post a Comment