Return to Snippet

Revision: 16386
at August 2, 2009 16:40 by deepsoul


Initial Code
# mkdir and cd into new Dir (accepts -p option of mkdir or creation of multiple dirs):
function mkcd() { mkdir "$@" && cd "${!#}"; }

# usage:
mkcd newdir
# or:
mkcd -p path/to/newdir

# cd .. and remove directory:
function rmcd() { cd .. && rmdir "${OLDPWD##*/}"; }

# usage, from empty directory you want to remove:
rmcd

Initial URL


Initial Description
Has saved me no end of typing over the years.

Initial Title
Combined make/remove and change directory

Initial Tags


Initial Language
Bash