Date: Fri, 13 May 2005 12:43:14 +0200 (CEST) From: Svein Halvor Halvorsen <svein-freebsd-questions@theloosingend.net> To: "Sergey S. Ropchan" <fenix@ramb.com.ua> Cc: Fafa Hafiz Krantz <fteg@london.com> Subject: Re: How to replace words in all files? Message-ID: <20050513122232.O5526@maren.thelosingend.net> In-Reply-To: <1115977253.28135.17.camel@sirius> References: <20050513092905.D003E4BEAD@ws1-1.us4.outblaze.com> <1115977253.28135.17.camel@sirius>
next in thread | previous in thread | raw e-mail | index | archive | help
* Sergey S. Ropchan [2005-05-13 12:40 +0300] > find / -name '*' -print | xargs grep "lnc0" > - gives you all files in your system with lnc0 ... > > perl -pi.bak -pe 's/lnc0/rl0/' file1 file2 ... fileN > - will replace lnc0 - rl0 in all specified files, with backuping of old > files in *.bak Or one could use with the -i option, since sed is in the base system (although everyone probably has perl anyway)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050513122232.O5526>