Saturday, December 3, 2011

mkdir on subfolders and cd

Add in .bash_profile
function mkdircd () { mkdir -p "$@" && eval cd "\"\$$#\""; }


ubuntu1004@ubuntu1004:~$ mkdircd /tmp/tmp1/tmp2/tmp3
ubuntu1004@ubuntu1004:/tmp/tmp1/tmp2/tmp3$ pwd
/tmp/tmp1/tmp2/tmp3

No comments:

Post a Comment