We Recommend

bash Cookbook: Solutions and Examples for bash Users bash Cookbook: Solutions and Examples for bash Users
bash Cookbook teaches shell scripting the way Unix masters practice the craft. It presents a variety of recipes and tricks for all levels of shell programmers so that anyone can become a proficient user of the most common Unix shell -- the bash shell -- and cygwin or other popular Unix emulation packages.


Posted By

benatkin on 01/19/07


Tagged

grep searching


Versions (?)


Grep for a string in all files in a directory and its subdirectories with a certain extension


Published in: Bash 


Searches all HTML files in current directory and subdirectory for the string "cookiemonster.html". Can be used to find which pages link to a page. Further tweaks can find which source files directly include a file. Both file names and the search string are case insensitive.


  1. fgrep -i 'cookiemonster.html' `find . -iname '*.html' -print`

Report this snippet 

You need to login to post a comment.