mkdir long-name-of-directory
cd long-name-of-directory
I checked what are the shourcuts for this. specially is there an one line command to both create and move in to the directory. Actually there is no one line command. But we can create one in our shell.
If you are using bash, following function can be added
mkcd () {
mkdir "$1"
cd "$1"
}
If you are using csh, you have to add an alias because C shell doesn't support function.
alias mkcd 'mkdir $PWD/\!:1;cd $PWD/\!:1'
If you are can't configure your enviorenment we can use following commands.
mkdir long-name-of-directory
cd !^
Let me know If you have any other solutions.
No comments:
Post a Comment