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 ~/.bashrcfunction 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 testFilewill create the testFile directory and make that your working directory. Horray for lazy! June 25, 2011