find . -exec grep "BLABLABLA" '{}' \; -print
What this does is as follows:
- First find all files starting at '.', ie: at my current location
- For every file that I find execute the command grep "BLABLABLA" '{}', where '{}' contains the results of the find command (in this case a listing of every file path.
- 'print' out any resulting files that have this text in it.
mkopka@random:~/$ find . -exec grep "year.development" '{}' \; -print
<center>Copyright © @year.development@ TerraPages International</center>
./src/html/common/footer.jsp.in
<filter token="year.development" value="2006, 2007" />
./build.xml
Which shows me that there are two files 'footer.jsp.in' and build.xml which have the text that I am looking for, and it also gives me the path to each file and the context of the text Im searching for is printed out.
Some links to more info:
- http://en.wikipedia.org/wiki/Find
- http://www.ibm.com/developerworks/aix/library/au-unix-find.html
No comments:
Post a Comment