- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Is there a way to remove a lot of directories at o...
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
Forums
Discussions
Discussions
Discussions
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
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
09-03-2003 04:26 AM
09-03-2003 04:26 AM
Is there a way to remove a lot of directories at once w/out having to empty them first
Any ideas of away to remove without having to go to each individual directory and remove the contents?
Your help is most appreciated.
Have a great day
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2003 04:30 AM
09-03-2003 04:30 AM
Re: Is there a way to remove a lot of directories at once w/out having to empty them first
Yes.
# rm -rf /thedir
Be *very* careful using the '-f' (force) option. Make sure you know what you are doing and where you are!
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2003 04:30 AM
09-03-2003 04:30 AM
Re: Is there a way to remove a lot of directories at once w/out having to empty them first
This will recurse
HTH.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2003 04:30 AM
09-03-2003 04:30 AM
Re: Is there a way to remove a lot of directories at once w/out having to empty them first
If you can get a list of the directories, you could do something like this (as root, preferably):
for dir in `cat dir_list`
do
rm -rf dir
done
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2003 04:31 AM
09-03-2003 04:31 AM
Re: Is there a way to remove a lot of directories at once w/out having to empty them first
# find /dir -exec rm -f {} \;
Robert-Jan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2003 04:33 AM
09-03-2003 04:33 AM
Re: Is there a way to remove a lot of directories at once w/out having to empty them first
Try
rm -rf /directory
Shaji
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2003 04:39 AM
09-03-2003 04:39 AM
Re: Is there a way to remove a lot of directories at once w/out having to empty them first
I think that the best solution is what some other experts also suggested above:
rm -Rf /thedir
Regards
ALPER ONEY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2003 04:43 AM
09-03-2003 04:43 AM
Re: Is there a way to remove a lot of directories at once w/out having to empty them first
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2003 11:47 AM
09-03-2003 11:47 AM
Re: Is there a way to remove a lot of directories at once w/out having to empty them first
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2003 11:55 AM
09-03-2003 11:55 AM
Re: Is there a way to remove a lot of directories at once w/out having to empty them first
That's kind of like curing a cold by chopping of your head isn't it? While that would work, it's a bit drastic. It would be MUCH faster than 'rm' would be though.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2003 01:43 PM
09-03-2003 01:43 PM
Re: Is there a way to remove a lot of directories at once w/out having to empty them first
Yes - it is drastic :)
Just on MC/SG II course - and we just did it to clear our vg's.
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2003 04:42 AM
09-04-2003 04:42 AM
Re: Is there a way to remove a lot of directories at once w/out having to empty them first
You may want to add
`pwd`
and maybe
`ls -ld ./dir`
before
`rm -rf ./dir`
just to make sure you are where you think you are.
(A foaf tried to rm all files in a subdirectory, but ran into permission problems -- so he did `su - ` (instead of `su`) followed by `rm -rf *` -- ouch.)
Rob