*BSD News Article 69858


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.uwa.edu.au!disco.iinet.net.au!news.uoregon.edu!vixen.cso.uiuc.edu!not-for-mail
From: mheins@prairienet.org (Mike Heins)
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: 31 May 1996 18:31:19 GMT
Organization: Prairienet
Lines: 33
Message-ID: <4ondtn$n89@vixen.cso.uiuc.edu>
References: <31ab29fe.17230986@news.hq.af.mil> <31ACEB04.136A@fsl.noaa.gov>
NNTP-Posting-Host: bluestem.prairienet.org
X-Newsreader: TIN [UNIX 1.3 950824BETA PL0]
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:20420 comp.lang.perl.misc:26905

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?
: 

Because every '-exec rm -f {}' creates a process, and if you are doing
lots of files, that can be slow.

Besides, find syntax for exec is extremely obtuse, and I can never
remember it. 8-)

-- 
Regards,
Mike Heins                          http://www.iac.net/~mikeh ___       ___
                                    Internet Robotics        |_ _|____ |_ _|
Few blame themselves until they     131 Willow Lane, Floor 2  | ||  _ \ | |
have exhausted all other            Oxford, OH  45056         | || |_) || |
possibilities.                                               |___|  _ <|___|
 -- anonymous                       mikeh@iac.net 513.523.5028   |_| \_\