PDA

View Full Version : delete a folder with LOTS of subfolders



daviddoria
20th January 2008, 06:06 AM
I screwed up and ran a backup scrip recursively (it was trying to backup a folder to a location within itself, so it resulted in /..../backup/stuff/backup/stuff/backup/stuff/backup/.....etc)

I ran
rm -rf backup
and it ran for hours and didn't finish.

i wanted to check how big this thing actually got with
du -hs backup

and it has been running for quite some time now too....

all I want to do is delete the whole !@#$ thing!! How else can I do that??

Thanks,

David

robatino
20th January 2008, 09:19 AM
While running the "rm -rf backup" in one window, run "df" in another window periodically to check on its progress. I don't think there's any faster way than the recursive rm. If you can remember roughly how much disc space was being used before, you can estimate the completion time.

Edit: Except possibly for backing up everything else, then installing from scratch - but hopefully it won't come to that.

kevmif
20th January 2008, 10:49 AM
Does rm actually remove a file or just deallocate the space in the allocation table?

Surely it shouldn't take that long. But running df is a good idea.

Does the harddrive light flicker whilst its running?

daviddoria
20th January 2008, 03:22 PM
Ok, so heres the report.

FIrst of all, this is all taking place on a network harddrive (Buffalo Linkstation Pro). While I'm running rm -rf, I check df from another terminal - nothing is changing!! The hard drive light is going crazy while this is happening, and stops when i cancel the rm -rf. What the heck???

I can just format that drive, but I thought this may be a good learning experience for a stronger "delete" tool.

Let me know if there are any other options

THanks!

David