Last Updated: November 30, 2021
·
3.16K
· drbunsen

mkdir + autocd zsh function

zsh function to create directories and autocd into the leaf

mkc () {
    mkdir -p "$@" && cd "$@"
}

Example:

$ mkc foo/bar/baz/bif

2 Responses
Add your response

Works as a charm on 5.0.2. Thanks!

over 1 year ago ·

Thank you so much! I've been searching everywhere for something that actually works on my zsh, and this is the only one.

over 1 year ago ·