Difference between revisions of "Grep"

From wiki
Jump to navigation Jump to search
(Created page with "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...")
(No difference)

Revision as of 12:26, 1 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
-n
Only report filname of files with matches
-h
Suppress reporting of filenames when multiple files are scanned.
-l
Report linenumber of matches too