in reply to Replace across files (extreme newbie)
The "." is the directory where the search will start, "-type f" is the condition for files that will be processed (this will process all regular files, you may want to narrow it to files with certain names, etc.), and the perl command will actually perform the replacement for each file, leaving the original in a file with the same name, but with termination ".bak". "x" and "y" are your search and replacement strings, and /g causes it to replace all ocurrences on every line.find . -type f -exec perl -pi.bak -e 's/x/y/g' {} \;
See the man page for the find command for more details on its options, and see the documentation for s for details on the substitution command itself.
--ZZamboni
|
|---|