Linux Basic Commands
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 practicecd practicemkdir -plinux/directory1ls -R
π This creates a structure like:
practice/βββlinux/βββdirectory1/
Try with Linux Pratice