/ Published in: Bash
Has saved me no end of typing over the years.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
# mkdir and cd into new Dir (accepts -p option of mkdir or creation of multiple dirs): function mkcd() { mkdir "$@" && cd "${!#}"; } # usage: mkcd newdir # or: mkcd -p path/to/newdir # cd .. and remove directory: function rmcd() { cd .. && rmdir "${OLDPWD##*/}"; } # usage, from empty directory you want to remove: rmcd