Search and Replace a string in any file

kick it on DotNetKicks.com
In UNIX environment, the following combination of perl and find will serch for a particular file and replace the occurence of a particular string with another string in that file. This will also work for multiple files and directories. The find command finds the file and the perl script replaces old string with the new one. perl -pi -e 's/old string/new string' `find . -name "file name"`

posted @ Monday, October 16, 2000 5:00 AM

Print

Comments on this entry:

No comments posted yet.

Your comment:






 
 
 
Please add 1 and 8 and type the answer here:
 

Live Comment Preview:

 
«November»
SunMonTueWedThuFriSat
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456