ezratechdev / mkcd

A simple linux script that makes a directory and cd into that same directory all with one command.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mkcd

A simple command to make a directory and cd into the same directory

Using your favourite editor edit the .bashrc file. You can do so by using nano as shown below

nano ~/.bashrc

Go to the section where you add aliases and functions / commands and add the code below

# User specific aliases and functions
mkcd(){
   mkdir "$1" && cd "$1"

}

Usage

Source the bashrc file

source ~/.bashrc

You can now head to your terminal and use the command as shown below

mkcd test

About

A simple linux script that makes a directory and cd into that same directory all with one command.