One command to create and change directory

Autom3 picture Autom3 · Jan 3, 2013 · Viewed 14.6k times · Source

I'm searching for just one command — nothing with && or | — that creates a directory and then immediately changes your current directory to the newly-created directory. (This is a question someone got for his exams of "linux-usage", he made a new command that did that, but that didn't give him the points.) This is on a debian server if that matters.

Answer

Marian Zburlea picture Marian Zburlea · Nov 3, 2014

I believe you are looking for this:

mkdir project1 && cd "$_"