Linux: Howto Make a Directory Command

by on February 10, 2010 · 0 comments· last updated at February 10, 2011

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

You need to use the mkdir command to create new folders or directories under Linux operating systems.

mkdir command Syntax

mkdir command has the following syntax:

 
mkdir dirname
mkdir dirname1 dirname2
mkdir -p dir1/dir2/dir3
 

Examples

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



You should follow me on twitter here or grab rss feed to keep track of new changes.

Featured Articles:

Previous Faq:

Next Faq: