From owner-freebsd-questions Sat Apr 25 09:57:42 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA16188 for freebsd-questions-outgoing; Sat, 25 Apr 1998 09:57:42 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from java.dpcsys.com (java.dpcsys.com [206.16.184.7]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id JAA16179 for ; Sat, 25 Apr 1998 09:57:29 -0700 (PDT) (envelope-from dan@dpcsys.com) Received: from localhost (dan@localhost) by java.dpcsys.com (8.8.7/8.8.2) with SMTP id JAA08906; Sat, 25 Apr 1998 09:58:43 -0700 (PDT) Date: Sat, 25 Apr 1998 09:58:43 -0700 (PDT) From: Dan Busarow To: Todd Backman cc: freebsd-questions@FreeBSD.ORG Subject: Re: Deleting files. In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sat, 25 Apr 1998, Todd Backman wrote: > How would one delete text files in a dir that contain a particular word. > > I would like to delete all files in the mailque that contain the word: > > "urgent" There's probably a cleaner way but you could use # grep -l urgent df* | sed 's/df/*/' | xargs rm You may need to escape the * or quote the whole word. Give it a try without the rm first, xarg's default is to just print the args. Dan -- Dan Busarow 714 443 4172 DPC Systems / Beach.Net dan@dpcsys.com Dana Point, California 83 09 EF 59 E0 11 89 B4 8D 09 DB FD E1 DD 0C 82 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message