From owner-freebsd-questions Wed Nov 6 10: 9:41 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 2F70737B48C for ; Wed, 6 Nov 2002 10:09:38 -0800 (PST) Received: from rwcrmhc52.attbi.com (rwcrmhc52.attbi.com [216.148.227.88]) by mx1.FreeBSD.org (Postfix) with ESMTP id CEB9F43E3B for ; Wed, 6 Nov 2002 10:09:37 -0800 (PST) (envelope-from pdb2@u.washington.edu) Received: from u.washington.edu ([12.231.115.57]) by rwcrmhc52.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20021106180936.DZGT19869.rwcrmhc52.attbi.com@u.washington.edu> for ; Wed, 6 Nov 2002 18:09:36 +0000 Message-ID: <3DC95ADF.1060306@u.washington.edu> Date: Wed, 06 Nov 2002 10:09:35 -0800 From: paul beard Organization: University of Washington User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.1) Gecko/20021101 X-Accept-Language: en-us, en MIME-Version: 1.0 To: questions Subject: Re: simple find command References: <200211061124.25334.mbettinger@championelevators.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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 Matthew Bettinger wrote: > -----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 > so maybe someone can help me out here. > > I have a list of files (hundreds) in directory . and need to search through > and delete every file that contains the word foo. If they're all in . and you need not descend into other directories, you can just use grep to find them. Replace ls -l with rm in the example: [/home/paul]:: grep -l foo * | xargs ls -l -- Paul Beard / 8040 27th Ave NE / Seattle WA 98115 / paulbeard [at] mac [ dot] com / 206 529 8400 weblog @ One reason why George Washington Is held in such veneration: He never blamed his problems On the former Administration. -- George O. Ludcke To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message