Plurrrr

Fri 31 May 2019

Make directories and change to the last one created

The following command makes several directories and changes into the last one created:

mkdir -p ~/foo/bar/baz && cd $_

In this example the current working directory is baz.

mkdir -p ~/foo/{baz,qux} && cd $_

And in this example the current working directory is qux.

In both cases you can verify the path of the current working directory with the pwd command.