• RSS
  • SmsJobs
  • Sms
  • GoogleBuzz
  • Facebook
  • Twitter
  • Linkedin
  • Youtube
The Linux Juggernaut

The Linux Juggernaut

roles on……

Do you like www.linuxnix.com ? Please consider supporting us by becoming a subscriber and get a Linux basics e-book for free.

FILES & FOLDERS PART-II


CREATING FOLDERS :
Cmd4a : Creating a single folder.

#mkdir foldername

Example :
#mkdir test

Cmd4b : Creating multiple folders at a time
#mkdir 1{1,2,3}
This command will create folders with name 11,12,13. You can see weather this folders are created or not by using ls or dir command.


Cmd4c : Creating multiple directories and sub directories at a time. This is very much advanced and very much useful command. Some times we have to create a directory structure with sub directories in it. Which are not exist before.
For example I want to create the directory structure as below
               /test
                / \
              /     \
           /           \
      user1       user2
       /  \            /  \
    /       \        /      \
 /            \    /          \
apple   goa pine     tom


So if I want to create these many folders at a time i have to execute the following commands.
First i have to create test directory, then I have to change the directory to it and the create two more directories as user1 and user2 and so on as below.
#mkdir test
#cd test
#mkdir user1
#mkdir user2
#cd user1
#mkdir apple
#mkdir goa
#cd ..
#cd user2
#mkdir pine
#mkdir tom

So you see these many commands i have to execute to create that directory structure. But in linux, its very much easy if you know this option with mkdir command. Execute the mkdir command with -p option it will create subdirectories though they didnt exist.


#mkdir -p test/{user1/{apple,goa}, user2/{pine,tom}}

Thats it you are done. This will create all the folders and sub folders.
Plese visit for remaining posts on files and folders operations..

Do you like www.linuxnix.com ? Please consider supporting us by becoming a subscriber and get a Linux basics e-book for free.
bySurendra On Wednesday-August - 12 - 2009

email newsletter

Redhat Flagship dist

Redhat announced that they are going to release RHEL7 by ...

12 examples to use f

Flower brackets examples This is a small post on how to ...

7 Linux read command

read command examples read command is useful in scripts when reading ...

7 linux sort command

Linux/Unix sort command examples This is a small tutorial on how ...

How to find command

How to find command location in Linux and Unix This is ...

  • About Linux Juggernaut

    How the blog name selected? Juggernaut: * a massive inexorable force that seems to crush everything in its way ...readmore>>

  • Contact Me

    Contact us Send an Email Phone number and vCard LinkedIn profile Advertise with us
  • About Me

    Surendra Kumar Chowdary

    My name is Surendra Kumar Anne. I am from Vijayawada which is cultural capital of south Indian state of Andhra Pradesh. I am a Linux evangelist who believes in Hard work, A down to earth person, Likes to share knowledge with others, Loves dogs, Likes photography. At present i work at Persistent Systems as Module Lead.   read more »