mkdir and cd at the Same Time

Fact: I'm lazy as hell. mkdir x && cd x for whatever reason just seems too long to create a directory and cd into it at the same time. To engage in my laziness, append the following to your ~/.bashrc
function mkcd(){
    mkdir -p $1 && cd $1
}
Now execute the command source ~/.bashrc so your session takes the edited file into account. Now simply executing
mkcd testFile
will create the testFile directory and make that your working directory. Horray for lazy! June 25, 2011
About the Author:

Joseph is the lead developer of Vert Studios Follow Joseph on Twitter: @Joe_Query
Subscribe to the blog: RSS
Visit Joseph's site: joequery.me