grep
You may also be interested in find
Contents
basic grep use
- with the line number
grep -sin "??OP" *l
- with just the name of the file
grep -sil "??OP" *l
recursive
- with the line number
grep --include "*.4gl" -sHIrin "\<spam\>" ./
- without the line number
grep --include "*.egg" -sIril "\<spam\>" ./
man
- -H : Print the filename for each match
- -i : Ignore case distinctions in both the PATTERN and the input files.
- -I : Process a binary file as if it did not contain matching data;
- -l : print only the name of each input file once
- -n : Prefix each line of output with the line number within its input file.
- -r : Read all files under each directory, recursively
- -s : Suppress error messages about nonexistent or unreadable files.
- -v : Invert the sense of matching, to select non-matching lines.