How can I create a reliable alias or function that let me create and cd into one directory?
I tried the following, but, as an example can't create directories with spaces.
mcd () {
mkdir $1 && cd $1
}
How can I create a reliable alias or function that let me create and cd into one directory?
I tried the following, but, as an example can't create directories with spaces.
mcd () {
mkdir $1 && cd $1
}
Always put double quotes between variable in bash to avoid space problem ;)
mcd () {
mkdir "$1" && cd "$1"
}