Results 1 to 3 of 3
How do I find a word in a file?
I want to search only files of a certain extension such as .html or .txt.
I want to search recursively since ...
- 07-01-2011 #1Just Joined!
- Join Date
- Jul 2011
- Posts
- 7
How to find a word in all files of type .html (or .txt)
How do I find a word in a file?
I want to search only files of a certain extension such as .html or .txt.
I want to search recursively since the files can be anywhere.
I tried the following command but it gave an error
$ grep -r "cell differentiation" *.html
The error was "*.html: No such file or directory".
If I leave off the *.html it scans every fracking file on the system.
- 07-02-2011 #2Just Joined!
- Join Date
- Mar 2011
- Posts
- 4
Use --include option for grep.
Code:grep -r "cell differentiation" . --include "*.html"
- 07-02-2011 #3Linux User
- Join Date
- Jan 2005
- Location
- Saint Paul, MN
- Posts
- 262


Reply With Quote
