|
/Admin/commandLine:
Search & Replace Text in multiple files and subdirectories
perl -e "s/OLDSTRING/NEWSTRING/g;" -pi.save $(find /path/to/directory/to/be/searched -type f)
grep -rl OLDSTRING . | xargs perl -pi~ -e 's/OLDSTRING/NEWSTRING/'
Note that "." above seems to include hidden files. Replace "." with "*" and hidden files are not included.
posted at: 04:07 | path: /Admin/commandLine | permanent link to this entry