LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 10-25-2006, 08:21 AM   #1
sravanth.svk
LQ Newbie
 
Registered: May 2006
Posts: 21

Rep: Reputation: 0
Question mkdir options


Hi every one,

I would like to know that is there any option to simplify
The usage of -p option in mkdir command
Ex:- mkdir -p dir1/sdir1 dir1/sdir2 dir1/sdir3 dir1/sdir1/csdir1 dir1/sdir1/csdir2

It might even extend on requirement so it would be better to have a bit simplified command using whilchord characters or any other thing

Thanking you all
sravanth.svk
 
Old 10-25-2006, 12:02 PM   #2
kenjoy
LQ Newbie
 
Registered: Oct 2006
Posts: 5

Rep: Reputation: 0
make clear ur thoughts, so we can help.
 
Old 10-25-2006, 12:29 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,974
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
Quote:
Originally Posted by sravanth.svk
Hi every one,

I would like to know that is there any option to simplify
The usage of -p option in mkdir command
Ex:- mkdir -p dir1/sdir1 dir1/sdir2 dir1/sdir3 dir1/sdir1/csdir1 dir1/sdir1/csdir2

It might even extend on requirement so it would be better to have a bit simplified command using whilchord characters or any other thing

Thanking you all
sravanth.svk
You could conceivably write a wrapper that takes the to
be newly created dir1 as the first parameter, and omit it
in the following .... but that's as good as it gets because the
script can't conceivably know on which level to create which
directory.


Cheers,
Tink
 
Old 10-25-2006, 01:29 PM   #4
penguin_powered
LQ Newbie
 
Registered: Apr 2004
Location: Houston, Texas
Distribution: Linux Mint 13, MATE 32-bit edition
Posts: 24

Rep: Reputation: 15
You're making it more complicated than it is.

No need for those short directory references when you're going to do this:

mkdir -p dir1/sdir1/csdir1 dir1/sdir1/csdir2

Pick your longest paths and put those in a simple text file and execute it.

Exactly how many layers do you want to create? This could be a fun challenge to write the smallest script to get the job done.
 
Old 10-26-2006, 12:31 AM   #5
kenjoy
LQ Newbie
 
Registered: Oct 2006
Posts: 5

Rep: Reputation: 0
Sure, u can process it with this small script, but every time u need create the small script by hand.

Quote:
Originally Posted by penguin_powered
You're making it more complicated than it is.

No need for those short directory references when you're going to do this:

mkdir -p dir1/sdir1/csdir1 dir1/sdir1/csdir2

Pick your longest paths and put those in a simple text file and execute it.

Exactly how many layers do you want to create? This could be a fun challenge to write the smallest script to get the job done.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
mkdir -p ? shanenin Linux - Software 4 10-19-2011 11:41 AM
mkdir script shelby Programming 3 11-29-2004 03:56 PM
mkdir help... Linux~Powered Linux - Software 2 06-13-2004 11:27 AM
mkdir doesn't work Kristian2 Slackware - Installation 7 06-10-2004 12:42 PM
mkdir help ITJedi Linux - Software 1 05-14-2004 05:19 PM


All times are GMT -5. The time now is 01:24 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration