Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Apr 1998 09:58:43 -0700 (PDT)
From:      Dan Busarow <dan@dpcsys.com>
To:        Todd Backman <tbackman@corp.gulf.net>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Deleting files.
Message-ID:  <Pine.BSF.3.96.980425095050.8858B-100000@java.dpcsys.com>
In-Reply-To: <Pine.BSI.3.95.980425111131.10912A-100000@marlin.corp.gulf.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.980425095050.8858B-100000>