-L,--files-without-match:列出文件内容不符合指定的字符的文件名称。-n,--line-number:在显示符合字符的那一行之前,标示出该行的列数编号。-o,--only-matching:只显示匹配PATTERN部分。-q,--quiet或--silent:
-v, --invert-match Invert matching. Show lines that do not match the given patterns. -w, --word-regexp Only show matches surrounded by word boundaries. This is roughly equivalent to putting \b before and after all of the search patterns. -x, --line-regexp Only show matches surrounded ...
-D,--devices=ACTION how to handle devices, FIFOs and sockets;ACTIONis'read'or'skip' -r,--recursive like --directories=recurse-R,--dereference-recursivelikewise, but followallsymlinks--include=FILE_PATTERNsearch only files that match FILE_PATTERN--exclude=FILE_PATTERNskip filesanddirectories matc...
显示不被pattern匹配到的行,就是取反 -v, --invert-match select non-matching lines(反转匹配选择非匹配行) grep -v “#” xxxx 1. 2. 3. 应用:不想看/etc/fstab文本中被“#”注释掉的行 grep -n 显示匹配的行号 -n, --line-number print line number with output lines 1. 2. grep -c 统计...
line-H,--with-filename print the file name for each match-h,--no-filename suppress the file name prefix on output--label=LABEL use LABEL as the standard input file name prefix-o,--only-matching show only the part of a line matching PATTERN-q,--quiet, --silent suppress all normal ...
-o, --only-matching show only the part of a line matching PATTERN -q, --quiet, --silent suppress all normal output --binary-files=TYPE assume that binary files are TYPE; TYPE is 'binary', 'text', or 'without-match' -a, --text equivalent to --binary-files=text ...
-o, --only-matching show only nonempty parts of lines that match -q, --quiet, --silent suppress all normal output --binary-files=TYPE assume that binary files are TYPE;TYPE is'binary','text', or'without-match'-a, --text equivalent to --binary-files=text ...
--only-matching show only the part of a line matching PATTERN -q, --quiet, --silent suppress all normal output --binary-files=TYPE assume that binary files are TYPE; TYPE is 'binary', 'text', or 'without-match' -a, --text equivalent to --binary-files=text ...
-w, --word-regexp force PATTERN to match only whole words g r e p一般格式为: CODE:grep [选项]基本正则表达式[文件] 这里基本正则表达式可为字符串。 单引号双引号 在g r e p命令中输入字符串参数时,最好将其用双引号括起来。 在调用模式匹配时,应使用单引号。