word searching

shadowfax

Registered
If I have a bunch of files that is text, is there a command in the terminal that can search through the whole directory and output its results? Thank you.
 
The grep command recoginzes some special characters to specify exactly where to search for your pattern. If you just want to look for a certain phrase use fgrep instead.

Search any file in the current directory:

fgrep "put your phrase here" *

Recursively search any file in the current directory and subdirectories:

fgrep -r "put your phrase here" .

For a case-insensitive search, add the -i option before the search phrase. To just output the file names containing the phrase add the -l option.
 
Back
Top