- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: directories
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-04-2010 09:34 PM
тАО07-04-2010 09:34 PM
i want to create multiple directories in one particular directories(apporximately around 150 folders).
Regds
Rajesh
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-04-2010 10:08 PM
тАО07-04-2010 10:08 PM
Solutionmkdir -p can be useful. Please have a look at mkdir man page:
http://docs.hp.com/en/B2355-90689/mkdir.1.html
Hope this helps.
Regards,
Bhadresh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-04-2010 10:15 PM
тАО07-04-2010 10:15 PM
Re: directories
for example :
mkdir /test/{1,2,3,4,5,6,7,8,9,10}{1,2,3,4,5,6,7,8,9,10}
mikap
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-05-2010 05:10 AM
тАО07-05-2010 05:10 AM
Re: directories
mikap,
A fine suggestion.
Thank you for reminding us of that.
You may have been too enthusiastic though.
Most probably do NOT want those 10's in there, but just zeroes.
For example: mkdir /test/{0..9}{0..9}
myself, I prefer a full prinf function to construct names as I like them.
For example using perl:
# perl -e 'for (1..150) { $x = sprintf "test_%03d", $_; mkdir $x }'
cheers,
Hein
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-05-2010 08:23 AM
тАО07-05-2010 08:23 AM
Re: directories
I'm not aware of this syntax working in a real shell?
You would have to use a while with typeset for leading zeros. Or create a file with your unique pattern of directory names.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-05-2010 08:53 AM
тАО07-05-2010 08:53 AM
Re: directories
Here it is:
- To create:
# perl -e 'while ($i++<150){system "mkdir test$i"}'
- To check:
# find . -type d -name "test*" | wc -l
150
Enjoy, Have fun!,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-05-2010 09:04 AM
тАО07-05-2010 09:04 AM
Re: directories
Hmm,
Why would use 'system' to launch a command, when a direct call is available, as I showed in my earlier alternative solution?
Using the 'system' step will be less efficient and has reduced error handling.
fwiw,
Hein