bash: mkdir + cd with one command

codedump:

function mkcd() {
  [ -n "$1" ] && mkdir -p "$@" && cd "$1";
}

Example:

user@host:~$ cd work
user@host:~/work$ mkcd website.com/{html,src,stuff}
user@host:~/work/website.com/html$
(this post was reblogged from codedump)

Notes

  1. hasenj-dev reblogged this from codedump
  2. codedump posted this