`mkdir` and `cd` at once

Dec 16
2009

I am sick of mkdir dir_name; cd dir_name;
The solution (put this function in “.bashrc” or whatever shell config file you use):

_mkcd () {
       mkdir -p $1
       cd $1
}
# usage: _mkcd /tmp/dir_1/dir_2
# pwd will show: /tmp/dir_1/dir_2

Leave a Reply

Calendar

December 2009
M T W T F S S
« Nov   Jan »
 123456
78910111213
14151617181920
21222324252627
28293031  

Tags