HAKATEMIA
07Linux command line

Creating directories

Easy10MIN

You can practice the taught commands on the command line at the bottom of the page. Execute the given tasks on the same command line.

Next, we will practice working with directories. Let's start by creating a new directory using the *mkdir-*command. The command comes from the words make directory, which literally means create a directory.

BASH
1mkdir directory

In the image below, we created a new directory named "harjoitus" and ensured that it was successfully created using the ls command.

It is also possible to create multiple directories by giving them consecutively to the mkdir command.

BASH
1mkdir direcotry1 direcotry2 directory3

In the image below, we created two new directories and verified that they were created successfully.

It is also possible to create new directories nested by giving the mkdir- command the -p - switch.

BASH
1mkdir -p directory1/directory2/directory3

In the image below, we created two nested directories and confirmed the successful execution of the command by running the ls command from inside the first directory.

1 / 2
Hakatemia Pro

Learn to hack — start here

Hundreds of interactive courses, virtual labs and CTF challenges in your browser. Start a free trial — no card required.