5. mkdir

mkdir Command in Linux

mkdir stands for "make directory".
It is used to
create a new folder (directory) in the Linux file system.


🔹 Basic Syntax:

mkdir [directory_name]

🔹 Examples:

1. Create a single directory

mkdir myfolder

👉 Creates a folder named myfolder in the current directory.


2. Create multiple directories at once

mkdir folder1 folder2 folder3

👉 Creates three folders in the current location.


3. Create nested directories (with -p option)

mkdir -p projects/linux/scripts

👉 Creates the full path, including parent folders if they don’t exist.


🔹 Verify the creation:

Use ls to list and confirm:

ls

🔹 Example in Practice:

cd ~
mkdir practice
cd practice
mkdir -p linux/directory1
ls -R

👉 This creates a structure like:

practice/
└── linux/
    └── directory1/

Try with Linux Pratice