Create and change to a new directory in a single shell command

Create and change to a new directory in a single shell command

To create and change to a new directory in a single shell command, you can use the mkdir and cd commands together with the && operator.

For example, to create a new directory named newdir and change to it, you can use the following command:

r‮t refe‬o:lautturi.com
mkdir newdir && cd newdir

This will create the newdir directory and then change to it.

You can also use the -p option with the mkdir command to create any necessary parent directories. For example, to create the directory /path/to/newdir and change to it, you would use the following command:

mkdir -p /path/to/newdir && cd /path/to/newdir
Created Time:2017-10-28 14:02:23  Author:lautturi