Ad space (banner)
🖥️Linux Lessons
Lesson 7 / 61

Creating a Folder with mkdir

mkdir is for when "I want to create a new folder." mkdir stands for Make Directory, and it creates a new folder (directory) with the given name.

Use it in the form mkdir folder-name. Give multiple folder names separated by spaces, and you can create several folders at once.

Running mkdir images creates an empty folder named images in your current location. You can confirm it afterward with ls.

A common early mistake is trying to create a deep path at once when the parent folders don't exist yet, hitting a "No such file or directory" error. In that case, use the -p option.

In real work, this comes up constantly when setting up a project skeleton, or preparing a folder to store logs — any time you're organizing directory structure.

Linux
Try it (type this into the pseudo terminal)
mkdir images

🧑‍💻 You can type this command into the Linux pseudo terminal to try it yourself (this page itself has no interactive terminal).

Ad space (banner)
Ad space (in-article)