From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from cpe-24-221-98-238.az.sprintbbd.net ([24.221.98.238] helo=lnx3.holmesgrown.com) by speech.braille.uwo.ca with esmtp (Exim 3.35 #1 (Debian)) id 17FDpX-00067E-00 for ; Tue, 04 Jun 2002 08:54:32 -0400 Received: (from steve@localhost) by lnx3.holmesgrown.com (8.11.4/8.11.4) id g54Csfc15825 for speakup@braille.uwo.ca; Tue, 4 Jun 2002 05:54:41 -0700 Date: Tue, 4 Jun 2002 05:54:41 -0700 From: Steve Holmes To: speakup@braille.uwo.ca Subject: Re: Deleting all empty files with a single command? Message-ID: <20020604055436.A15814@lnx3.holmesgrown.com> References: <007101c20b70$49fdaec0$a06fe9d5@microsoft.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from armoi@sci.fi on Tue, Jun 04, 2002 at 08:59:58AM +0300 Sender: speakup-admin@braille.uwo.ca Errors-To: speakup-admin@braille.uwo.ca X-BeenThere: speakup@braille.uwo.ca X-Mailman-Version: 2.0.9 Precedence: bulk Reply-To: speakup@braille.uwo.ca List-Help: List-Post: List-Subscribe: , List-Id: Speakup is a screen review system for Linux. List-Unsubscribe: , List-Archive: Hey, good comment. I had no idea the find command was so powerful myself. In the past, I have used the find command to create a list and pipe that into a script but this sounds more concise. See, we learn something every day:). On Tue, Jun 04, 2002 at 08:59:58AM +0300, Ari Moisio wrote: > Hi! > > Octavian Rasnita 03.06.02: > > >I want to delete all empty files from a directory with a single command. > >What switch should I use to "select" all the empty files? > > In command line you can write: > find . -maxdepth 1 -type f -size 0 -exec rm {} \; > > ...well: find is a command to find files for certain criteria. First > dot means start from current directory, -maxdepth 1 means not recursing > into subdirectories, -type f means only ordinary files, -size 0 is quite > obvious and -exec will launch rm to erase file if all previous > conditions are met. {} in exec is replaced by file name and \; means end > of -exec command. > > To see more options see find man page:-) > > -- > Mr. Ari Moisio, Niittykatu 5, 41160 Tikkakoski, +358-40-5055239 > ari.moisio@iki.fi http://www.iki.fi/arimo PGP-keyID: 0x3FAF0F05 > > > _______________________________________________ > Speakup mailing list > Speakup@braille.uwo.ca > http://speech.braille.uwo.ca/mailman/listinfo/speakup