3 ms·
ccd() { mkdir -p $1 cd $1 } cdtemp() { cd $(mktemp -d) }
by nektro 3y ago
ccd() {
mkdir -p $1
cd $1
}
cdtemp() {
cd $(mktemp -d)
}
- GhostWhisperer 3y agooh yea, slight name difference: alias mkdir='mkdir -pv' function take() { mkdir $1 cd $1 } i'm going to steal that cdtemp function though
- spelufo 3y agoSame here. I call it mkcd
- Leftium 3y agomine's called cdd, and it's a little more complex: cdd () { case "$1" in */..|*/../) cd -- "$1";; # that doesn't make any sense unless the directory already exists /*/../*) (cd "${1%/../*}/.." && mkdir -p "./${1##*/../}") && cd -- "$1";; /*) mkdir -p "$1" && cd "$1";; */../*) (cd "./${1%/../*}/.." && mkdir -p "./${1##*/../}") && cd "./$1";; ../*) (cd .. && mkdir -p "${1#.}") && cd "$1";; *) mkdir -p "./$1" && cd "./$1";; esac } https://unix.stackexchange.com/a/9124/4791 https://unix.stackexchange.com/a/9124/4791