From owner-freebsd-questions@FreeBSD.ORG Sat May 30 22:58:06 2009 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 1C09C106566C for ; Sat, 30 May 2009 22:58:06 +0000 (UTC) (envelope-from vogelke@hcst.com) Received: from beta.hcst.com (beta.hcst.com [192.52.183.241]) by mx1.freebsd.org (Postfix) with ESMTP id B902E8FC0C for ; Sat, 30 May 2009 22:58:05 +0000 (UTC) (envelope-from vogelke@hcst.com) Received: from beta.hcst.com (localhost [127.0.0.1]) by beta.hcst.com (8.13.8/8.13.8/Debian-3) with ESMTP id n4UMw4Uc015661 for ; Sat, 30 May 2009 18:58:04 -0400 Received: (from vogelke@localhost) by beta.hcst.com (8.13.8/8.13.8/Submit) id n4UMw4xG015660; Sat, 30 May 2009 18:58:04 -0400 Received: by kev.msw.wpafb.af.mil (Postfix, from userid 32768) id 61E46BECA; Sat, 30 May 2009 18:26:34 -0400 (EDT) To: freebsd-questions@freebsd.org In-reply-to: (z.szalbot@lcwords.com) Organization: Oasis Systems Inc. X-Disclaimer: I don't speak for the USAF or Oasis. X-GPG-ID: 1024D/711752A0 2006-06-27 Karl Vogel X-GPG-Fingerprint: 56EB 6DBF 4224 C953 F417 CC99 4C7C 7D46 7117 52A0 Message-Id: <20090530222634.61E46BECA@kev.msw.wpafb.af.mil> Date: Sat, 30 May 2009 18:26:34 -0400 (EDT) From: vogelke+unix@pobox.com (Karl Vogel) Subject: Re: find and searching for specific expression in files X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: vogelke+unix@pobox.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 May 2009 22:58:06 -0000 >> On Sat, 30 May 2009 11:25:12 +0200, >> "Zbigniew Szalbot" said: Z> Can you please give me a hint how to use find to search for a specific Z> text within files? People have mentioned using xargs in combination with find, but if you're dealing with Windows files on a server, be prepared for every kind of crap character in the filename you can imagine. Use nulls to delimit the filenames, i.e.: find . -mtime +7 -print0 | xargs -0 grep -i foo The GNU versions of find and xargs support the "0" options as well. -- Karl Vogel I don't speak for the USAF or my company iPod changed my life. Earbuds made me look so cool! Now I am stone deaf. --geek haiku