[Techtalk] zero byte file deletes

Paul W list3 at truswan.com
Sun Nov 6 10:49:47 EST 2005


Mary wrote:

> On Sat, Nov 05, 2005, Almut Behrens wrote:
> 
>>  find . -size 0 -exec rm -f {} \;
>>  find . -maxdepth 1 -size 0 -exec rm -f {} \;
> 
> 
> It seems like Almut's command worked out fine for Paul, but just in
> case, it's often worth rnning find without the -exec to see what files
> it thinks matches. Eg, "find . -size 0" will give you a *list* of all
> files with zero bytes. If that list looks fine you can run "find . -size
> 0 -exec rm -f {} \;"  otherwise, no harm done. (This is much like the
> idea that before you run "rm *" you should run "ls *" to see what * is
> going to match.)
> 
Exactly what I've already done.

Paul


More information about the Techtalk mailing list