On Mon, Apr 7, 2008 at 2:27 PM, Tanveer Singh <[EMAIL PROTECTED]> 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.

Hmm well that statement will take a lot longer than an rm -rf! But the
mv idea is a good one if all you want is to make the directory
invisible to some process that expects it to be named a certain way.
Just rename the directory to a different name for a quick 'delete' and
then do an rm -rf when you have more time..

-- Anupam

_______________________________________________
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