Search and Replace over Multiple Files

December 30th, 2008 Category: Linux

Sometimes you need to search and replace strings over multiple files. This can easily be done using perl. I found this tip from www.liamdelahunty.com/tips

perl -pi -w -e 's/search/replace/g;' *.php

-e means execute the following line of code.
-i means edit in-place
-w write warnings
-p loop
Share and Enjoy:
These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • StumbleUpon
  • Reddit
  • Webnews
  • MisterWong
  • Y!GG
  • Facebook
  • Furl
  • Google Bookmarks
  • Live-MSN
  • Readster
  • YahooMyWeb

Related posts:

  1. Make VIM Nice Looking
  2. How do you protect your Blog from Hackers?
This entry was posted on Tuesday, December 30th, 2008 and is filed under Linux. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply