复制 grep[OPTION]...PATTERN[FILE]...Usage:grep[OPTION]...PATTERN[FILE]...SearchforPATTERNineachFILEor standard input.PATTERNis,bydefault,a basic regularexpression(BRE).Example:grep-i'hello world'menu.h main.c Regexp selection and interpretation:-E,--extended-regexpPATTERNis an extended regul...
--fixed-strings PATTERN is a set of newline-separated fixed strings-G,--basic-regexp PATTERN is a basic regular expression (BRE)-P,--perl-regexp PATTERN is a Perl regular expression-e,--regexp=PATTERN use PATTERN for matching-f,--file=FILE obtain PATTERN from FILE-i,--ignore-case ig...
-rw-r--r--. 1 root root 0 Nov 3 00:10 zero [root@linuxforliuhj test]# 1. 2. 3. 4. 5. 匹配中括号范围内的任意一个字符 [root@linuxforliuhj test]# export LC_ALL=C [root@linuxforliuhj test]# ll [a-z]* -rw-r--r--. 1 root root 0 Nov 3 00:09 alis.txt -rw-r--...
Usage:grep[OPTION]...PATTERN[FILE]...SearchforPATTERNineachFILEor standard input.PATTERNis,bydefault,a basic regularexpression(BRE).Example:grep-i'hello world'menu.h main.c Regexp selection and interpretation:-E,--extended-regexpPATTERNis an extended regularexpression(ERE)-F,--fixed-stringsPATT...
For example, to display all the lines containing the string bash from the /etc/passwd file, you would run the following command: 例如,要显示/etc/passwd 文件中包含字符串 bash 的所有行,可以运行以下命令: 代码语言:javascript 复制 grep bash/etc/passwd ...
On the other hand, when reading files whose text encodings are unknown, it can be helpful to use -a or to set LC_ALL='C' in the environment, in order to find more matches even if the matches are unsafe for direct display. -D ACTION, --devices=ACTION If an input file is a ...
For example, to display all the lines containing the string bash from the /etc/passwd file, you would run the following command: 例如,要显示/etc/passwd 文件中包含字符串 bash 的所有行,可以运行以下命令: grep bash /etc/passwd 1. 输出应该是这样的: ...
[vagrant@localhost tasks]$ echo"aaaaabbbb"| grep"a{5}" //{ 和 }需要转义,否则不起作用,而是被当作普通的字符串[vagrant@localhost tasks]$ echo"aaaaabbbb"| grep a\{5\} //包含特殊字符时如果不加引号,不起作用 [vagrant@localhost tasks]$ echo"aaaaabbbb"| grep"a\{5\}" //经过转义和使用...
这个选项可设置为以 STRING 分隔 --no-group-separator 不同的组,不做分隔 1.3.6 文件和目录选项 -a, --text 把二进制文件当做文本文件处理,有可能输出垃圾信息,产生边际效应。 (输出的信息被终端解释为其他命令) 等同于 --binary-files=text --binary-files=TYPE ...
grep - print lines matching a patterngrep [OPTIONS] PATTERN [FILE...] grep [OPTIONS] [-e PATTERN | -f FILE] [FILE...]