I want to create command to create new directory and jump into it immediately and I found this solution. Just add md () { mkdir "$1" && cd "$1" ; }
function to .bashrc
. Oke this is my intruction.
Go to home directory
cd ~
Open and edit .bashrc
file with vim or nano
nano .bashrc
Add function to end of command. Exit with ctrl+x y and enter
md () { mkdir "$1" && cd "$1" ; }
Reopen your terminal or restart it
exec bash -l
Now you can create new directory and jump into it immediately with
md directory_name
Top comments (0)