Tables
Introduction
As part of my RHCSA + RHCE Fast-Track Training with the Cloud Whistler community, I’m continuing to document everything I learn—this time from Day 4 of my 30-day Linux challenge.
In this post, I’ve shared the importance of mkdir command for structuring wise files and projects folders.
Overview of mkdir
What is mkdir?
mkdir stands for make directory. It's used to create new folders (directories) in your Linux file system.
Hands-On Scenarios and Lessons Learned
🛠️ Hands-On Scenarios and Lessons Learned
Creating a single folder in the top level directly /
Mkdir /aws : command to create a folder in top level directory
How to create more than directories
Mkdir /uk /Canada /Australia : command to create a more than one folder directories in top directory
How to create multiple directories
Mkdir /azure{1..5} : command to create a multiple folder directories in top directory
Create a directory inside a directory
Create a Parent directory inside another directory
Mkdir -p /gcp/v1/v2/v3
Mistakes to Avoid
Here are a couple of things that tripped me up early on while using mkdir:
Missing the -p flag for nested folders
If you try to create a folder inside another one that doesn’t exist yet, you’ll get an error like:
mkdir: cannot create directory ‘/path/to/folder’: No such file or directory
Just add the -p flag to tell Linux to create any missing parent folders too:
*mkdir -p /path/to/folder
*
Spaces in folder names without quotes
If your folder name has spaces (like My Folder), Linux thinks you're typing two separate arguments. Wrap it in quotes or escape the space:
mkdir "My Folder"
mkdir My\ Folder
Trust me, these small things can save a lot of time and confusion when you're just getting started!
Quick Summary
mkdir might look simple at first, but once you get the hang of its options, it becomes a powerful tool for staying efficient and organized.A well-structured file system not only makes your life easier down the road
Got a favorite Linux command or a hard lesson learned? I’d love to hear it. Let’s swap stories—connect with me on https://www.linkedin.com/in/dinesharumugam86/#.