From owner-freebsd-questions@FreeBSD.ORG Sat Dec 11 02:03:49 2004 Return-Path: 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 2377716A4CE for ; Sat, 11 Dec 2004 02:03:49 +0000 (GMT) Received: from mta9.adelphia.net (mta9.adelphia.net [68.168.78.199]) by mx1.FreeBSD.org (Postfix) with ESMTP id B4C3E43D49 for ; Sat, 11 Dec 2004 02:03:48 +0000 (GMT) (envelope-from parv@chvlva.adelphia.net) Received: from default.chvlva.adelphia.net ([69.160.65.78]) by mta9.adelphia.netESMTP <20041211020348.CDDM14438.mta9.adelphia.net@default.chvlva.adelphia.net>; Fri, 10 Dec 2004 21:03:48 -0500 Received: by default.chvlva.adelphia.net (Postfix, from userid 1000) id D6EC45571; Fri, 10 Dec 2004 21:03:40 -0500 (EST) Date: Fri, 10 Dec 2004 21:03:40 -0500 From: Parv To: antenneX Message-ID: <20041211020340.GA568@moo.holy.cow> Mail-Followup-To: antenneX , freebsd-questions@freebsd.org References: <019101c4de0e$dbdeb2d0$0200000a@SAGEAME> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <019101c4de0e$dbdeb2d0$0200000a@SAGEAME> cc: freebsd-questions@freebsd.org Subject: Re: Find & Replace string X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Dec 2004 02:03:49 -0000 in message <019101c4de0e$dbdeb2d0$0200000a@SAGEAME>, wrote antenneX thusly... > > In a website of 1.GB+ with several hundred thousand files, I need > to interrogate all files to replace a single string like > "oldone.010" with "newone.011" > > What's the best way to do this? Find yourself if the following is the best way ... fgrep -r -l 'oldone.010' parent-directory-of-files \ | xargs perl -pi -e 's[oldone\.010]/newone.011/g' - Parv --