From owner-freebsd-questions@FreeBSD.ORG Sat Aug 14 19:58:18 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1EFA10656A6 for ; Sat, 14 Aug 2010 19:58:18 +0000 (UTC) (envelope-from bonomi@mail.r-bonomi.com) Received: from mail.r-bonomi.com (ns2.r-bonomi.com [204.87.227.129]) by mx1.freebsd.org (Postfix) with ESMTP id 9DC8F8FC1A for ; Sat, 14 Aug 2010 19:58:18 +0000 (UTC) Received: (from bonomi@localhost) by mail.r-bonomi.com (8.14.3/rdb1) id o7EJvYAa017901; Sat, 14 Aug 2010 14:57:34 -0500 (CDT) Date: Sat, 14 Aug 2010 14:57:34 -0500 (CDT) From: Robert Bonomi Message-ID: <201008141957.o7EJvYAa017901@mail.r-bonomi.com> To: freebsd-questions@freebsd.org, jacks@sage-american.com Cc: Subject: Re: Grepping a list of words X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Aug 2010 19:58:19 -0000 > From owner-freebsd-questions@freebsd.org Thu Aug 12 05:36:27 2010 > Date: Wed, 11 Aug 2010 18:00:22 -0500 > To: freebsd-questions@freebsd.org > From: "Jack L. Stone" > Subject: Grepping a list of words > > Kindly appreciate help with how to grep (or similar) a list of words to > determine if any of them are in a file rather than grepping one word at a > time. > > Thanks for any suggestions... > 1) egrep "(word1|word2|word3|word4|....|wordN)" file 2) grep -F -f wordlist_file sourcefile The proverbial advice about "the fine manpage" is relevant. :) `