htmlfind - tpcclib 0.8.0 © 2023 by Turku PET Centre

Program for searching HTML and XHTML code in a specified file or in every
file with extensions *.htm, *.html and *.xhtml that are found under the
specified path. Optionally, the (X)HTML code fragment can be changed to
the given text in every place where it is found.
 
Usage: htmlfind [options] path_or_file search_text
 
Options:
 -replace <Substitute text>
     Search text is replaced by specified text in every instance;
     substitute must not contain certain special characters like '&'
 -replace-from-file <Filename>
     Search text is replaced in every instance by the contents of
     the specified ASCII text file, including new line characters;
     text length must not exceed 2047 characters
 -case[-sensitive]
     Search is case-sensitive. By default, upper-and lowercase letters
     are considered equal
 -h, --help
     Display usage information on standard output and exit.
 -v, --version
     Display version and compile information on standard output and exit.
 -d[n], --debug[=n], --verbose[=n]
     Set the level (n) of debugging messages and listings.
 -q, --quiet
     Suppress displaying normal results on standard output.
 -s, --silent
     Suppress displaying anything except errors.
 
Example 1:
Command for finding out if and where the specified HTML file
contains HTML code fragment '<a href=':
     htmlfind webpage.html "<a href="
 
Example 2:
Command for replacing a web address with another in all HTML
files which can be found in the current directory and below it:
     htmlfind -replace www.new.fi . www.old.fi
 
Alternatively, in bash you can search a string in files using grep
from files with certain extension, for example:
     grep "string_to_search" . -R --include "*.c" 
 
Keywords: HTML, tools