Quote:
Originally posted by Centinul
just out of curiousity and since I'm new to linux can someone explain what that code does? Thanks!
|
Code:
find 'root' -type f -iname "*.html" -exec sed -i 's/regexp/replacement/g' '{}' \;
find - The name of a command to find files/directories.
'root' - The path of the diretory you weant to start searching in, e.g. /home/centinul
-type f - Find regular files.
-iname "*.html" - Do a case insensitive search to match <anything>.html
-exec - execute the following, up to the \;, once for each result of the search, replacing '{}' with the file name.
sed - The name of a command to edit text
-i - Do the editing in place, not to the console or another file.
's/regexp/replacement/g' - 'do a search and replace / look for text that matches this regular expression / replace it with this text / do it globally, dont stop at the first match'