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
-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...
-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 patterns, and therefore matches nothing. 从文件中获取模式,每行一个。如果此选项...
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. -i, --ignore-case Ignore case distinctions in patterns and input data, so that characters that differ...
--exclude=PATTERN 在目录中递归搜索,但是跳过匹配PATTERN的文件。 -s,--no-messages 禁止输出关于文件不存在或不可读的错误信息。对于可移植性需要注意:与GNUgrep不同,传统的grep不遵守POSIX.2规范,因为传统的grep缺少一个-q选项,而它的-s选项与GNUgrep的-q选项行为相似。需要可移植到传统grep的 shell 脚本应当...
-e PATTERNS, --regexp=PATTERNS Use PATTERNS as the patterns. If this option is used multiple times or is combined with the -f (--file) option, search for all patterns given. This option can be used to protect a pattern beginning with “-”. -f FILE, --file=FILE Obtain patterns fro...
Use the-eoption to search formultiple patterns in a single grep command: grep -e 'server' -e 'cloud computing' -e 'phoenix' example_file2.txtCopy Alternatively, usegrep -E(equivalent to the olderegrep command) for a similar effect with extended regular expressions: ...
--exclude=GLOB Skip files whose base name matchesGLOB. Seeglob(7)for wildcards you can use. You can use this option multiple times to exclude more patterns. It takes precedence over--include. Note, that in- and excludes apply only to files found via--recursiveand not to the argument lis...
Thefgrep commandsearches a file or list of files for a fixed pattern string. It is the same asgrep -F. A common way of usingfgrepis to pass a file of patterns to it: fgrep –f file_full_of_patterns.txt file_to_search.txt
If the first few bytes of a file indicate that the file contains binary data, assume that the file is of type TYPE. By default, TYPE is binary, and grep normally outputs either a one-line message saying that a binary file matches, or no message if there is no match. If ...