Perl Find and Replace One Liner

Posted on the January 20th, 2010 under HOWTOs,Sys Admin by jglemza

I’m constantly needing a way to easily change a line in a bunch of configuration files. I thought I’d share the way I do it here.

perl -p -i -e 's/oldstring/newstring/g' *

This allows you to use a regular expression and perform the find and replace.

2 Responses to 'Perl Find and Replace One Liner'

  1. October 14, 2011 at 3:54 am
    Stefan
  2. October 14, 2011 at 7:36 am
    jglemza

Leave a Reply




XHTML::
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


*