0
      1
      2
      3
      4
      5
      6


Very useful search and replace command for the linux command line. This command is made up of a find command to find the files that you want and a perl command to do the text replacement.

The first part “find . -type f -name “*.html” -print” finds all of the files starting at the current directory that end with .html. The “-type f” makes sure that only files are found and not directories. The string that comes after the -name parameter is the filename to find. The -print parameter just prints the
the relative path to the found file.

The -exec parameter is used to execute a command with the found file. Everything after the -exec is executed until it reaches “;”.

Continue reading Search and Replace Text in Files Recursively

Date posted: May 15, 2010 | Author: | No Comments »

Categories: Linux

Tags: ,

Copyright © 2013, Neil Bittner. All Rights Reserved.