Skip to content
This repository was archived by the owner on Jan 16, 2024. It is now read-only.

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

mcd

Tired of running mkdir and then typing cd to go into the newly created directory?

mcd is a simple and shorthand function that does both in one go.

How to install

Either download/clone this repository and add the following to your ~/.bashrc file:

source path/to/mcd.inc

or alternatively just copy-paste the function directly into your ~/.bashrc file:

mcd () {
    if [ $# = 0 ]; then
        echo "Usage: mcd <directory>"
        return
    fi
    mkdir -p "$1" && cd "$1"
}

NB: The source approach is recommended if you end up picking up more than one of these bookmarklets as it avoids clutter.

About

Shorthand function for creating a directory and cd into it afterwards

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages