Fgrep

来自WordPress中文文档
跳转至: 导航搜索

Linux命令:fgrep

功能说明:查找文件里符合条件的字符串。
语  法:fgrep [范本样式][文件或目录...]
补充说明:本指令相当于执行grep指令加上参数"-F",详见grep指令说明。


英文版本,欢迎翻译:

ABOUT FGREP

Search a file for a fixed-character string.

SYNTAX

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

-b Precede 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). -c Print only a count of the lines that contain the pattern. -h Suppress printing of files when searching multiple files. -i Ignore upper/lower case distinction during comparisons. -l Print the names of files with matching lines once, separated by new-lines. Does not repeat the names of files when the pattern is found more than once. -n Precede each line by its line number in the file (first line is 1). -s Work silently, that is, display nothing except error messages. This is useful for checking the error status. -v Print all lines except those that contain the pattern. -x Print only lines matched entirely. -e pattern_list Search for a string in pattern-list (useful when the string begins with a -). -f pattern-file Take the list of patterns from pattern-file. pattern Specify a pattern to be used during the search for input. file A path name of a file to be searched for the patterns. If no file operands are specified, the standard input will be used.

EXAMPLES

fgrep "support" myfile.txt - Would search for support in the file myfile.txt.