mkdir foo and immediately cd into it
http://superuser.com/questions/152794/is-there-a-shortcut-to-mkdir-foo-and-immediately-cd-into-it
# ~/.bashrc
function mkcd {
if [ ! -n "$1" ]; then
echo "Enter a directory name"
elif [ -d $1 ]; then
echo "\`$1' already exists"
else
mkdir $1 && cd $1
fi
}
Written by Brett
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Cd
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#