Linux: Howto Make a Directory Command

by on February 10, 2010 · 5 comments· LAST UPDATED July 29, 2013

in , ,

How do I make directory under Linux operating systems using the command prompt or bash shell?

You need to use the mkdir command to create new folders or directories under Linux operating systems. A directory (also known as folder in MS-Windows/OS X) is nothing but a container for other directories and files.

mkdir command Syntax

Tutorial details
DifficultyEasy (rss)
Root privilegesNo
Estimated completion timeLess than a minute
The mkdir command has the following syntax:

mkdir dirname
mkdir dirname1 dirname2
mkdir [option] dieNameHere
mkdir -p dir1/dir2/dir3


Open a terminal and use the mkdir command to create empty directories. The following command would create a directory called foo:
$ mkdir foo
To list directories, enter:
$ ls
$ ls -l

The following command would create two directories within the current directory:
$ mkdir tom jerry
$ ls -l

The -p option allows you to create parent directories as needed (if parent do not already exits). For example, you can create the following directory structure:
$ mkdir -p ~/public_html/images/trip

Sample mkdir demo

Animated gif 01: mkdir in action under Linux / Unix like operating systems

Animated gif 01: mkdir in action under Linux / Unix like operating systems

See also
Tweet itFacebook itG+ itDownload PDF versionFound an error/typo on this page?

{ 5 comments… read them below or add one }

1 Abhishek January 10, 2014 at 7:27 am

I really love your concepts of .gif file, which first time anyone assumes, it is a video.

Hats off to You :)

And yes, thank you very much, Whenever I need to learn something regarding linux commands, I used to check from your website.

Thank You Very Much For That


2 Nix Craft January 10, 2014 at 9:33 am

You are welcome, and thanks for the kind comments!


3 Antony James January 20, 2014 at 5:45 am

Very Gooddd……….


4 varun vishal January 24, 2014 at 8:46 am

sahi hai boss


5 Ashay February 15, 2015 at 5:03 am

Thanks, I can now finally create a directory in my VPS.


Leave a Comment

Tagged as: , ,

Previous Faq:

Next Faq: