-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 ...
--line-buffered flush output on every 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 PA...
--line-buffered flush output on every 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 PA...
-L,--files-without-match:列出文件内容不符合指定的字符的文件名称。-n,--line-number:在显示符合字符的那一行之前,标示出该行的列数编号。-o,--only-matching:只显示匹配PATTERN部分。-q,--quiet或--silent:
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 ...
同时使用--ignore-case和--only-match选项时,grep会失败。示例: $ echo "abc" | grep -io abc abc $ echo "ABC" | grep -io abc $ 但 $ echo "abc" | grep -i abc abc $ echo "ABC" | grep -i abc ABC 根据手册页: -o, --only-matching Show only the part of a matching line...
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 output--binary-files=TYPE assume that binary files are TYPE;TYPEis'binary','text',or'without-match' ...
-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 ...
--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 ...