This can be used to specify multiple search patterns, or to protect a pattern beginning with a hyphen (-). (-e is specified by POSIX.) -f FILE, --file=FILE Obtain patterns from FILE, one per line. The empty file contains zero patterns, and therefore matches nothing. (-f is specified...
Obtain patterns from FILE, one per line. If this option is used multiple times or is combined with the -e (--regexp) option, search for all patterns given. The empty file contains zero patterns, and therefore matches nothing. 从文件中获取模式,每行一个。如果此选项多次使用或与-e(——reg...
This option can be used to protect a pattern beginning with “-”. -f FILE, --file=FILE Obtain patterns from FILE, one per line. If this option is used multiple times or is combined with the -e (--regexp) option, search for all patterns given. The empty file contains zero ...
The grep command searches for lines that contain strings that match a pattern. Every line contains the empty string, so an empty pattern causes grep to find a match on each line. It is not the only such pattern: ‘^’, ‘$’, ‘.*’, and many other patterns cause grep to match eve...
Search for Multiple Patterns Use the -e option to search for multiple patterns in a single grep command: grep -e 'server' -e 'cloud computing' -e 'phoenix' example_file2.txtCopy Alternatively, use grep -E (equivalent to the older egrep command) for a similar effect with extended regular...
-e PATTERN, --regexp=PATTERN Use PATTERN as the pattern. This can be used to specifymultiple search patterns, or toprotecta patternbeginning with a hyphen(-). (-e is specified by POSIX.) -f FILE, --file=FILE Obtain patterns from FILE, one per line. The empty file contains zero patte...
grep - print lines matching a patterngrep [OPTIONS] PATTERN [FILE...] grep [OPTIONS] [-e PATTERN | -f FILE] [FILE...]
With the help of‘-e’ optionin grep command, we can search multiple patterns in a single command. Example is listed belpw: $ grep -e nobody -e mail /etc/passwd mail:x:8:8:mail:/var/mail:/usr/sbin/nologin nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin ...
grep searches for PATTERNS in each FILE. PATTERNS is one or more patterns separated by newline characters, and grep prints each line that matches a pattern.
In addition, two variant programs egrep and fgrep are available. Egrep is the same as grep -E. Fgrep is the same as grep -F. OPTIONS -A NUM, --after-context=NUM Print NUM lines of trailing context after matching lines. Places a line containing -- between contiguous groups of matches....