Fundamentals

Creating folders

Easy
25 min

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 folders. Let's start by creating a new folder using the mkdir-command. The command comes from the words make directory, which means create a folder.

mkdir folder

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

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

mkdir folder1 folder2 folder3

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

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

mkdir -p folder1/folder2/folder3

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

Training

Use the mkdir command in the desired way and build the folder structure according to the instructions.

In a Linux environment, the tilde (~) character refers to the user's home directory, meaning that ~/ is the same as /home/student/. The folder ~/example is the same as the folder /home/student/example.

Exercises

Task 1

Create a folder ~/backups

Task 2

Create a folder ~/backups/2021

Task 3

Create the folder structure ~/projects/linux/2023

hakatemia pro

Ready to become an ethical hacker?
Start today.

As a member of Hakatemia you get unlimited access to Hakatemia modules, exercises and tools, and you get access to the Hakatemia Discord channel where you can ask for help from both instructors and other Hakatemia members.