Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Possibly related – one of my most used keystroke-saving aliases/functions is:

    mcd () {
        mkdir -p "$*" && cd "$*"
    }
…which, quite obviously, creates a directory and jumps into it.

Note: the name overrides the GNU Mtools' mcd (https://www.gnu.org/software/mtools/manual/mtools.html#mcd) on some systems – choose another name if you need the tool. The original mcd "changes MSDOS directory" according to it's manpage, and wants to do something with a floppy drive when i run it by mistake.



Zsh has a built in like this called `take` that which quite nifty


Thanks, didn't know that. I just copied the mcd function from .bashrc to .zshrc when i switched ~5 years ago…




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: