Quiet; do not write anything to standard output. Exit immediately with zero status if any match is found, even if an error was detected. Also see the -s or --no-messages option. 安静的;不要向标准输出写入任何内容。如果发现任何匹配,立即退出,状态为零,即使检测到错误。还可以查看-s或-no-mes...
When grep stops after NUM matching lines, it outputs any trailing context lines. When the -c or --count option is also used, grep does not output a count greater than NUM. When the -v or --invert-match option is also used, grep stops after outputting NUM non-matching lines. -o,...
To match blank lines, use the pattern ‘^[[:blank:]]*$’. 即,grep 命令认为每一行都包含空字符串,所以提供的匹配模式为空字符串时,会匹配到所有行。 匹配模式写为 '^'、'$'、'.*',也是会匹配到所有行。 如果想要匹配空行,匹配模式可以写为 '^$',空行只包含一个行末的换行符。 如果想要匹配只...
-q, --quiet, --silent Quiet; do not write anything to standard output. Exit immediately with zero status if any match is found, even if an error was detected. 即,-q 选项指定不打印任何内容到标准输出,即使遇到错误也不打印,只会返回命令执行的结果,如果匹配返回 0,否则返回非 0 值。 可以用 ...
--include=FILE_PATTERN search only files that match FILE_PATTERN --exclude=FILE_PATTERN skip files and directories matching FILE_PATTERN --exclude-from=FILE skip files matching any file pattern from FILE --exclude-dir=PATTERN directories that match PATTERN will be skipped. ...
-q, --quiet, --silent Quiet; do not write anything to standard output. Exit immediately with zero status if any match is found, even if an error was detected. Also see the-sor--no-messagesoption. (-q is specified by POSIX.) 专门适合编写脚本?
MATCHING ERRORS It is possible to supply a regular expression that takes a very long time to fail to match certain lines. Such patterns normally involve nested indefinite repeats, for example: (a+)*\d when matched against a line of a's with no final digit. The PCRE matching function has...
-L 或 --files-without-match : 列出不匹配的文件名称。 -n 或 --line-number : 在显示符合条件的那一行之前,标示出该行的行号。 -q 或 --quiet或--silent : 不显示任何信息。 -r 或 --recursive : 此参数的效果和指定"-d recurse"参数相同,表示递归的过滤。
When grep stops after NUM matching lines, it outputs any trailing context lines. When the -c or --count option is also used, grep does not output a count greater than NUM. When the -v or --invert-match option is also used, grep stops after outputting NUM non-matching lines. -o, ...
This regular expression matches any "word" that begins with a letter (upper or lower case). For example, "words" that begin with a digit would not match. The grep command lists the lines that contain a match. More Information CategoryCommandLine ...