I see this code used in so many README files and I always scratch my head...
mkdir myAppName
cd myAppName
This is perhaps the simplest possible function you can write in bash, and should be a built-in function:
mcd () {
mkdir $1
cd $1
}
So instead of the above, you simple type:
mcd myAppName
... and you have both created a directory and navigated into it.
All you have to do is add that function to your profile, which is one of the following:
- ~/.bashrc
- ~/.bash_profile
- ~/.zshrc
- ~/.zsh_profile
- ~/.profile
Add that function to any of those files you have in your $HOME directory!