From owner-freebsd-questions Wed Nov 6 9:28:53 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 830A637B401 for ; Wed, 6 Nov 2002 09:28:52 -0800 (PST) Received: from smtp.accelernet.net (smtp.accelernet.net [208.159.164.211]) by mx1.FreeBSD.org (Postfix) with SMTP id CEC9D43E42 for ; Wed, 6 Nov 2002 09:28:51 -0800 (PST) (envelope-from mbettinger@championelevators.com) Received: (qmail 691 invoked by uid 82); 6 Nov 2002 17:27:13 -0000 Received: from 208-169-162-132.hou.accelernet.net (HELO helpdesk.championelevators.com) (208.169.162.132) by smtp.accelernet.net with SMTP; 6 Nov 2002 17:27:13 -0000 Content-Type: text/plain; charset="us-ascii" From: Matthew Bettinger Reply-To: mbettinger@championelevators.com Organization: Champion Elevators, inc. To: Subject: simple find command Date: Wed, 6 Nov 2002 11:24:19 -0600 User-Agent: KMail/1.4.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200211061124.25334.mbettinger@championelevators.com> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I am having a bit of trouble with the find command. I am a novice in its= use=20 so maybe someone can help me out here.=20 I have a list of files (hundreds) in directory . and need to search throu= gh=20 and delete every file that contains the word foo. Some of my failed attemps... find . -exec grep -i "foo" -ok -delete {} \; find . -exec grep -l 'foo' -ok -delete {}\; find . -exec grep "foo" {}\; | xargs rm Thanks for any help. Matt=20 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD) iD8DBQE9yVBIXG7+MmNwciURAr1VAKCJWZF87EfqAk8hLdnj/prlZwpVDwCbBrAt Lq+3Zv2Ocd4EmxAXfdhp1OY=3D =3DHNAV -----END PGP SIGNATURE----- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message