Grep: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
No edit summary |
||
| Line 14: | Line 14: | ||
;-n | ;-n | ||
:Report linenumber of matches too | :Report linenumber of matches too | ||
;-f <file> | |||
:Get patterns from <file>. One(1) pattern per line. | |||
Revision as of 10:47, 16 November 2018
Find pattern in data stream (files, standard input)
- grep <pattern> <files>
- Find pattern in any of the files.
- When multiple files are scanned the filename is reported too (see -h below)
- Useful options
- -i
- Ignore case
- -l
- Only report filename of files with matches
- -h
- Suppress reporting of filenames when multiple files are scanned.
- -n
- Report linenumber of matches too
- -f <file>
- Get patterns from <file>. One(1) pattern per line.