If you pipe your find output to xargs it will run a lot faster : find 
somedir ¦ xargs rm -rf should make quick work of the files.

Justin

On Mon, 7 Apr 2008 4:57 am, Tanveer Singh wrote:
> On Mon, Apr 7, 2008 at 2:21 PM, Anupam Jain <[EMAIL PROTECTED]> wrote:
>  >
>  > On Mon, Apr 7, 2008 at 1:57 PM, Tanveer Singh <[EMAIL PROTECTED]> 
> wrote:
>  >  > I have a directory called "somedir"
>  >  >  Inside this directory there are thousands of 
> subdirectories(20,000+)
>  >  >  and even more number of small files(100,000+)
>  >  >  If I do a \rm -rf somedir, it takes hours.
>  >  >  Is there a way to quickly delete this directory.
>  >  >  Currently I use Konqueror and it does the job more quickly, but 
> still
>  >  >  its pretty slow.
>  >
>  >  1) You can run the process in the background so that you can still 
> do
>  >  other work.
>  >  OR
>  >  2) use the --directory option which will unlink the directory even 
> if
>  >  it's non empty. But in this case the system will recursively unlink
>  >  all the files the next time you run fsck and you'll have to wait a
>  >  long time then.
>  >
>  >  Basically if you want to do something NOW which expects the 
> directory
>  >  to not be there, go with option 2. Else stick to the usual option 
> 1.
>  >
>  >  -- Anupam
>  Currently I do this
>  mv somedir somedir.old
>  find somedir.old -name "*" -exec rm -rf {} \;
>  I was hoping for some "quick delete" kind of stuff.
>
> _______________________________________________
> ilugd mailinglist -- [email protected]
> http://frodo.hserus.net/mailman/listinfo/ilugd
> Next Event: http://freed.in - February 22-24, 2008
> Archives at: http://news.gmane.org/gmane.user-groups.linux.delhi 
> http://www.mail-archive.com/[email protected]/
_______________________________________________
ilugd mailinglist -- [email protected]
http://frodo.hserus.net/mailman/listinfo/ilugd
Next Event: http://freed.in - February 22-24, 2008
Archives at: http://news.gmane.org/gmane.user-groups.linux.delhi 
http://www.mail-archive.com/[email protected]/

Reply via email to