Skip to content

Bash: Create a directory and CD into it with one command

Michael Watts edited this page May 22, 2019 · 1 revision

Put this in your .bashrc, .zshrc, etc.

# mkdir and cd into it
function mkd () {
  mkdir -p "$*"
  cd "$*"
}

The new improved mkd will let you make a new directory and change into it with support for directory names that contain spaces, and the creation of new directory hierarchies.

SSH

2 Best practices when logging in remotely to linux machine

WARGAMES

Clone this wiki locally