Need a new directory in Linux? One command does it:
mkdir folder_nameThat's it. The mkdir command — short for "make directory" — ships with every mainstream Linux distribution and pretty much every Unix-like system. Everyone who is a beginner or advanced Linux administrator somehow is looking to create a folder or directory in Linux with one of the most commonly used commands. Linux is widely adopted due to its stability and flexibility, and the terminal is one of the key features of Linux. Below you'll find the syntax, the options that actually matter, permission handling, and the three errors that trip up almost everyone at some point.
📌 What Is the mkdir Command in Linux?
If you want to make a directory, you can use the mkdir command to create single or multiple directories. mkdir doesn't copy anything, it doesn't move anything — it just makes an empty container where you can later store files and subdirectories. You run it from the terminal, in any shell (bash, zsh, sh, whatever you're using). If you're new to the ecosystem, start with What is Linux? to understand the fundamentals.
Folder vs Directory in Linux
People argue about this. Honestly, they're the same thing in everyday use. "Folder" is the desktop GUI word; "directory" is the term the kernel, the man pages, and every sysadmin actually use. If you search for how to create a folder in Linux terminal, you're looking for mkdir.
Basic mkdir Syntax
mkdir [OPTION]... DIRECTORY...The three options you'll use 95% of the time:
| Option | What it does | Typical use case |
-p |
Creates missing parent directories; no error if the target already exists | Nested paths like projects/app/logs |
-m |
Sets permissions (octal mode) at creation time | mkdir -m 750 private |
-v |
Verbose — prints a line for each directory created | Scripts, bulk creation, sanity checks |
🛠️ How to Create a Single Directory in Linux
To run the mkdir command, go to the terminal and open it with admin access if you have one. Otherwise, you just need the right and appropriate access to execute the command. Always remember that the options in Linux are case-sensitive.
mkdir monovm
ls -ld monovm
The directory lands in your current working directory. Not sure where that is? Run pwd first — it's worth the two seconds. If you want to verify the result of the directory creation, you can use the ls command.
Create a Directory in Another Path
mkdir /home/user/projectsThat's an absolute path — it starts with / and always points to the same place no matter where you are in the filesystem. A relative path (like projects/app) is resolved from wherever you currently stand. Beginners mix these up constantly, which is exactly how you end up with a stray directory in your home folder. If you need to move around first, change directories with cd.
📦 How to Create Multiple Directories at Once
Create Multiple Directories with One Command
mkdir dir1 dir2 dir3Space-separated names, one command, three directories. Watch out for names containing spaces — mkdir my project creates two directories, not one. Quote it instead: mkdir "my project". My advice? Skip spaces entirely and use hyphens or underscores. Your future self writing shell scripts will thank you.

Use Brace Expansion for Naming Patterns
mkdir project-{dev,test,prod}The shell expands that into project-dev, project-test, and project-prod. No spaces inside the braces — that's the one rule people break. Ranges work too:
mkdir month-{01..12}
🏗️ How to Create Parent and Nested Directories with mkdir -p
Example of Nested Directory Creation
mkdir -p projects/app/logsOne command, three levels deep. The -p flag (for "parents") builds every missing directory in the chain. It's also idempotent — run it twice and it won't complain, which makes it safe inside scripts and deployment jobs.

Once you run the mkdir command with the complete path, you can run the ls -R command to confirm the creation of the directory. This option will show the recursive directory tree.
What Happens If You Don't Use -p
$ mkdir projects/app/logs
mkdir: cannot create directory 'projects/app/logs': No such file or directoryPlain mkdir refuses to create a child when the parent doesn't exist. That error message confuses a lot of people, but it's just telling you the middle of the path is missing. Add -p.

🔐 How to Set Permissions While Creating a Directory
Use mkdir -m
mkdir -m 755 app
ls -ld appOctal modes read as owner-group-others, where 4 = read, 2 = write, 1 = execute. So 755 means the owner can read, write, and enter the directory, while everyone else can read and enter but not write.

Safer Permission Examples
755— web-facing directories that others need to read750— shared with a specific group, hidden from everyone else700— private to you only (keys, credentials, personal backups)
And please don't reach for 777. It hands write access to every user and every process on the box. I've cleaned up after that decision on more than one shared server, and the fix is never fun. Use chown to change directory ownership instead of loosening permissions for everyone. If you need to manage user access more broadly, learn how to create users in Linux.
How umask Affects Default Permissions
When you create a directory without -m, Linux starts from mode 777 and subtracts your umask. With the common default umask of 022, new directories land at 755. A umask of 077 gives you 700. Check yours with umask. Note that -m overrides umask entirely — and if you need to adjust things after the fact, you can change directory permissions with chmod.
✅ How to Verify That a Directory Was Created
ls -ld app
pwd
stat appThree tools, three jobs. ls -ld shows the directory itself rather than its contents — that lowercase d matters. pwd confirms you're in the location you think you're in. stat gives you the full picture: mode, owner, group, size, and timestamps.

If you have tree installed, tree projects renders the whole hierarchy visually, which is great for checking nested builds. You can also use the ls command to verify the directory alongside its neighbors. Need to find something deeper? Here's how to find file and directory in Linux.
⚠️ Common mkdir Errors and How to Fix Them
Permission Denied
$ mkdir /root/newdirectory
mkdir: cannot create directory '/root/newdirectory': Permission deniedYou don't have write access to the parent directory. Either create it somewhere you own (your home directory) or prefix with sudo if the location genuinely needs root — think /var/www or /opt. Use sudo deliberately, not reflexively.
File Exists
mkdir: cannot create directory 'logs': File existsSomething with that name is already there — possibly a file, not a directory. Run ls -ld logs to see what you're dealing with, then rename or use mkdir -p if you simply want the command to succeed quietly.
No Such File or Directory
A parent in the path is missing, or you typo'd it. Add -p, or double-check the spelling and whether you meant an absolute path.
🗑️ mkdir vs rmdir vs rm -r
| Command | Purpose | Works on |
mkdir |
Create directories | New or nested paths |
rmdir |
Delete a directory | Empty directories only |
rm -r |
Delete recursively | Directories with contents |
Deletion deserves its own caution. rm -r doesn't ask twice and there's no recycle bin. Always run ls -l on the target first.
🧪 Practical mkdir Examples
mkdir ~/projects/myapp
mkdir -p ~/backups/2026/08
mkdir -m 750 /var/www/private-appThe first creates a project folder inside an existing projects directory. The second builds a dated backup path — year and month — in one shot, perfect for a cron job. The third sets up a web app directory that the owner and its group can use, but nobody else can read. Once the structure exists, you'll want to create files inside the new directory with touch.
🎯 Conclusion
mkdir is a small command with a few sharp edges: -p for nested paths, -m for permissions, and an awareness of umask so you don't end up with directories that are wider open than you intended. With this guide, you will be able to understand the working of the mkdir command and use it along with various options. Make sure to use the right option in the right scenario to get the correct result. The options are case-sensitive.
Next up, bookmark our Linux commands cheat sheet, learn how to connect to your Linux server via SSH, and practice these commands on a Linux VPS where breaking things costs you nothing but a rebuild.