delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/05/15/23:41:29

From: Jason Green <news AT jgreen4 DOT fsnet DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: recursive rm
Date: Mon, 15 May 2000 23:21:49 +0100
Organization: Customer of Planet Online
Lines: 35
Message-ID: <s2s0issvuiqb2585skrdihs2lik6qlj3vo@4ax.com>
References: <8fpiqe$gpr$1 AT slb6 DOT atl DOT mindspring DOT net>
NNTP-Posting-Host: modem-90.sulfur.dialup.pol.co.uk
Mime-Version: 1.0
X-Trace: news7.svr.pol.co.uk 958429373 31454 62.136.15.90 (15 May 2000 22:22:53 GMT)
NNTP-Posting-Date: 15 May 2000 22:22:53 GMT
X-Complaints-To: abuse AT theplanet DOT net
X-Newsreader: Forte Agent 1.7/32.534
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

jrl AT netcom DOT com (Dr. J. Robert Lee) wrote:

> > For example, suppose there are files called
> > 
> > /frog/toad/bill/fred/tadpole.o
> > /frog/toad/bill/squid.o
> > /frog/toad/polywog.o
> > /frog/food.o
> > /frog/puddle.o
> > 
> > What I would like to be able to do is execute a
> > command such as the following to get rid of all
> > of the files that end in .o
> 
> These are the suggestions for Unix. DOS anyone?

There are DJGPP ports of common Unix utilities.  Even the bash shell
has been ported, so the advice given for Unix can apply to DOS too.
See the FAQ for descriptions of the packages available.

> find . -name "*.o" -exec rm {} \;

Given your description of the problem, that seems a little over
complicated.  Won't the following command do what you want?:

rm /*/*.o

That will delete all the .o files in any sub-directories on the
current drive.  You can test to see what files will be affected with
the command:

ls /*/*.o

The rm and ls utilities are in the fil316b.zip package, see the FAQ
for more details.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019