Make and open linux directory with one commmand

2

1

Instead of doing:

mkdir build
cd build

or:

mv build build_2017_03_03
cd build_2017_03_03

What is one command that does both?

user1271772

Posted 2017-03-03T15:28:06.387

Reputation: 161

Answers

3

There's no built-in command that does this, but you can create a shell function that does it, like this: mdcd () { mkdir $1; cd $1; } You can change mdcd to any name you want. You can create an analogous function for mv + cd as well.

Joseph Sible-Reinstate Monica

Posted 2017-03-03T15:28:06.387

Reputation: 1 420