Quickest way to delete many small files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Be careful, I had made a big mistake here. 'mktemp -d' creates a 
directory in /tmp, and, surely, it is another file system. So 'mv' will 
just 'cp'. So ${tempdirname} should be in the some file system as <dir>

Regards,
Pablo.

El 12/06/2013 08:16 p.m., Liam Slusser escribi?:
> So combining the two approaches I think that this may be a better 
> solution?
>
> tempdirname=`mktemp -d`
> mv <dir> $tempdirname
> mkdir <dir>
>
> # rm -rf <tempdirname>
> mkdir empty
> rsync -a --delete empty/ $tempdirname
> rmdir empty $tempdirname
>
>
>
> Regards,
> Pablo.



[Index of Archives]     [Gluster Development]     [Linux Filesytems Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux