Can you combine the following commands into one without using the directory name twice:
mkdir api
cd api
The answer is in the first comment of this post
Can you combine the following commands into one without using the directory name twice:
mkdir api
cd api
The answer is in the first comment of this post
mkdir api && cd $_
I can save a character here!
mkdir api; cd $_
I can save one more char, though I wouldn’t recommend it for readability reasons
mkdir api;cd $_
Permanent function (.bashrc):
function mkcd { command mkdir $1 && cd $1 }
zsh:
take 'dirname'