I used this shell script to search through some web directories for references to particular strings – just for future reference.
The find command only greps in html, php and pdf files: the -o switch is an OR.
The find command only greps in html, php and pdf files: the -o switch is an OR.
#!/bin/bash
PATHTOSEARCH=/path/to/webroot
FIND=/usr/bin/find
NICE=/bin/nice
PATTERN=’Media,1234,en.pdf|Media,1235,en.pdf|Media,1236,en.pdf’$NICE $FIND $PATHTOSEARCH -type f \( -name ‘*.html’ -o -name ‘*.php’ -o -name ‘*.htm’ -o -name ‘*.pdf’ \) -exec egrep “$PATTERN” {} \; -print