From owner-freebsd-questions Wed Nov 11 09:47:44 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA12782 for freebsd-questions-outgoing; Wed, 11 Nov 1998 09:47:44 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from laker.net (jet.laker.net [205.245.74.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id JAA12768 for ; Wed, 11 Nov 1998 09:47:40 -0800 (PST) (envelope-from sfriedri@laker.net) Received: from nt (digital-pbi-158.laker.net [208.0.233.58]) by laker.net (8.9.0/8.9.LAKERNET.NO-SPAM.SPAMMERS.AND.RELAYS.WILL.BE.TRACKED.AND.PROSECUTED.) with SMTP id MAA02129; Wed, 11 Nov 1998 12:43:38 -0500 Message-Id: <199811111743.MAA02129@laker.net> From: "Steve Friedrich" To: "Alain G. Fabry" , "freebsd-questions@FreeBSD.ORG" Date: Wed, 11 Nov 1998 12:41:43 -0500 Reply-To: "Steve Friedrich" X-Mailer: PMMail 98 Professional (2.01.1600) For Windows NT (4.0.1381;3) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: Re: find and replace within files. Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, 11 Nov 1998 11:11:32 -0600, Alain G. Fabry wrote: >Is there any way in FreeBSD that I can search in files for certain lines and >replace them with something else? >f.e. search for Name and replace with Last_Name >This needs to be done thruogh a whole directory tree. >Can you refer me to a command which will do this? Most experienced unix users, AFAIK, would use sed for this. I believe sed is fairly difficult to master quickly from the man page and I think your need is immediate. I suggest getting a book on sed from O'Reilly, see www.ora.com Unix systems measure "uptime" in years, Winblows measures it in minutes. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message