I often find myself making a directory and then immediately moving to it. I created a shortcut by modifying my .bash_profile file. I added the following code to the bottom:
That way, all I have to type into Terminal in order to make and change to a new directory is this
I'd like to be able to use -p, -v, -m, etc. for mkdir and -p, -l, -n, -v, etc. for cd. How would you suggest going about and doing that, seeing as I am combining two commands into one?
I was thinking something along the lines of this:
Let me know what you think.
Code:
mac(){
mkdir "$1"
cd "$1"
}
Code:
mac [directory]
I was thinking something along the lines of this:
Code:
mac(){
mkdir "$1 $2"
cd "$1 $3"
}