*BSD News Article 69954


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.rmit.EDU.AU!news.unimelb.EDU.AU!munnari.OZ.AU!news.ecn.uoknor.edu!news.wildstar.net!imci5!pull-feed.internetmci.com!news.internetMCI.com!newsfeed.internetmci.com!uwm.edu!chi-news.cic.net!arclight.uoregon.edu!dispatch.news.demon.net!demon!awfulhak.demon.co.uk!awfulhak.demon.co.uk!awfulhak.demon.co.uk!not-for-mail
From: brian@awfulhak.demon.co.uk (Brian Somers)
Newsgroups: comp.unix.bsd.freebsd.misc,comp.lang.perl.misc
Subject: Re: Deleting Empty Files
Followup-To: comp.unix.bsd.freebsd.misc,comp.lang.perl.misc
Date: 1 Jun 1996 04:33:59 +0100
Organization: Coverform Ltd.
Lines: 27
Message-ID: <4oodn7$57u@anorak.coverform.lan>
References: <31ab29fe.17230986@news.hq.af.mil> <31ACEB04.136A@fsl.noaa.gov> <wvx20k07nvn.fsf@gateway.novasoft.com>
X-NNTP-Posting-Host: awfulhak.demon.co.uk
X-Newsreader: TIN [version 1.2 PL2]
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:20504 comp.lang.perl.misc:27040

B. K. Oxley (binkley) <Brian.Oxley@Novasoft.COM> (Brian.Oxley@NOVASOFT.COM) wrote:
: >>>>> "RLS" == Randal L Schwartz <merlyn@stonehenge.com> writes:
: In article <ukviheigh0.fsf@julie.teleport.com> merlyn@stonehenge.com (Randal L. Schwartz) writes:

: >>>>> "Sean" == Sean Kelly <kelly@fsl.noaa.gov> writes:
:  Sean> Scott Gregory wrote:
:  >>> Is there a utility or script that will delete files that are
:  >>> empty??

:  Sean> find <options> <dirs> -size 0 -type f | xargs rm -f

: Why would you do this in the first place?  Why not:

:   $ find <options> <dirs> -size 0 -type f -exec rm -f \{\} \;

: Which doesn't expand or interpret the filenames?

xargs us usually better 'cos it doesn't kick off rm once for every file.
If people are running around creating silly file names, the sysadm should
be careful (and slower) and use your suggestion.  Either way, deleting
arbitrary "found" files as root is asking for it !

Why do you want to do this ?  Out of inodes ?

--
Brian <brian@awfulhak.demon.co.uk>
Don't _EVER_ lose your sense of humour....