grep
searches files for text.
grep [options] <text> <file pattern>
Flag | Description |
---|---|
-r | Recursively searches files specified in the directory as the <file pattern> argument |
-R | Like -r but follows symbolic links |
-i | Ignore case |
-n , –line-number | Display line numbers |
Recursive, case-insensitive search of the current directy for the word “todo”, displaying line numbers:
grep -rin todo .