*BSD News Article 69727


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!news.sdsmt.edu!nntp.uac.net!news.tufts.edu!blanket.mitre.org!news.mathworks.com!newsfeed.internetmci.com!csn!nntp-xfer-1.csn.net!csn!nntp-xfer-2.csn.net!news.boulder.noaa.gov!news
From: Sean Kelly <kelly@fsl.noaa.gov>
Newsgroups: comp.unix.bsd.freebsd.misc,comp.lang.perl.misc
Subject: Re: Deleting Empty Files
Date: Wed, 29 May 1996 18:25:40 -0600
Organization: NOAA Forecast Systems Laboratory
Lines: 13
Message-ID: <31ACEB04.136A@fsl.noaa.gov>
References: <31ab29fe.17230986@news.hq.af.mil>
NNTP-Posting-Host: emu.fsl.noaa.gov
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 2.0 (X11; I; HP-UX B.10.01 9000/715)
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:20321 comp.lang.perl.misc:26661

Scott Gregory wrote:

> Is there a utility or script that will delete files that are empty??

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

See `man find' for more details on the <options> you may or may not
need.  <dirs> is one or more directories in which to do the deed.

-- 
Sean Kelly                          
NOAA Forecast Systems Laboratory    kelly@fsl.noaa.gov
Boulder Colorado USA                http://www-sdd.fsl.noaa.gov/~kelly/