Команда egrep

Search a file for a pattern using full regular expressions.

Синтаксис

egrep [-b] [-c] [-h] [-i] [-l] [-n] [-s] [-v] [-x] [ -e pattern_list ] [-f file ] [ strings ] [ file]

-bPrecede each line by the block number on which it was found. This can be useful in locating block numbers by context (first block is 0).
-cPrint only a count of the lines that contain the pattern.
-hSuppress printing of filenames when searching multiple files.
-iIgnore upper/lower case distinction during comparisons.
-lPrint the names of files with matching lines once, separated by NEWLINEs. Does not repeat the names of files when the pattern is found more than once.
-nPrecede each line by its line number in the file (first line is 1).
-sWork silently, that is, display nothing except error messages. This is useful for checking the error status.
-vPrint all lines except those that contain the pattern.
-xConsider only input lines that use all characters in the line to match an entire fixed string or regular expression to be matching lines.
-e pattern_listSearch for a pattern_list (full regular expression that begins with a -).
-f fileTake the list of full regular expressions from file.
stringsSpecify a pattern to be used during the search for input.
fileA path name of a file to be searched for the patterns. If no file operands are specified, the standard input will be used.

Примеры

egrep "support|help|windows" myfile.txt - Would search for patterns of support help and windows in the file myfile.txt.

Обратно к списку команд




гранитные памятники, на выставке более 300 моделей памятников.