Results 1 to 3 of 3
I've stupidly set up an rsync backup of a sessions directory and there's probably around 50 million files in there now (at a rough guess).
I've tried to delete the ...
- 10-13-2008 #1Just Joined!
- Join Date
- Oct 2008
- Posts
- 1
How can I delete 50 million small files?
I've stupidly set up an rsync backup of a sessions directory and there's probably around 50 million files in there now (at a rough guess).
I've tried to delete the directory but with no success.
The command I've been using is:
find . -type f -exec rm -v {} \;
What else can I try?
- 10-13-2008 #2
To delete a directory you need to use the command "rmdir", or add a "-r" flag to the rm command.
Welcome to the forums by the way!
Registered Linux user #388328 || Registered LFS user #15880
AMD 64 X2 4600+ :: 2X1GB DDR2 800 :: GeForce 9400 GT 512MB :: ASUS M2N32 Deluxe :: 4X250GB SATAII
Need instant help? Try us on IRC -- #linuxforums on freenode
- 10-15-2008 #3Linux Guru
- Join Date
- Nov 2007
- Location
- Córdoba (Spain)
- Posts
- 1,513
In which sense doesn't it work? It should (only for files, not dirs, as specified by -type f).
The only thing you are missing is proper quoting around the brackets '{}', which you should always use unless you are 100% sure that no file in there holds special characters on its name.
That, provided that you have write permissions over those files, of course.


Reply With Quote

