$ mkcd(){ NAME=$1; mkdir -p "$NAME"; cd "$NAME"; }
Aug. 3, 2017, 6:49 a.m.
—
PrasannaNatarajan
Explanation
Paste this function in the ~/.bashrc
file.
Usage:
mkcd name1
This command will make a new folder called name1
and cd
into the name1
.
I find myself constantly using mkdir
and going into the folder as the next step. It made sense for me to combine these steps into a single command.