Ridiculously useful Bash shell functions

Put these in your ~/.bash_profile.

function mkcd ()
{
    mkdir -p $1 && cd $1
}

function cdrm ()
{
    THIS=`pwd`
    cd ..
    rmdir $THIS
}

mkcd makes a directory, then changes into it.

cdrm changes to the parent directory, then removes the one you were just in.

Leave a Reply