grep参数说明及常用用法 查看文件内容 [kou@localhost ~]$ more size.txt b124230 b034325 a081016 m7187998 m7282064 a022021 a061048 m9324822 b103303 a013386 b044525 m8987131 B081016 M45678 B103303 BADc2345 [] : 查看符合范围内的信息 [kou@localhost ~]$ more size.txt | grep ['a'-'b'] b124230 b034325 a081016 a022021 a061048 b103303 a013386 b044525 []*查看文件中有范围内的,并标注 -i:忽略大小写比较 [kou@localhost ~]$ more size.txt | grep -i b b124230 b034325 b103303 b044525 B081016 B103303 BADc2345 -v: 反向查找 [kou@localhost ~]$ cat size.txt | grep -v '1' b034325 m7282064 m9324822 b044525 M45678 BADc2345 -c:输出计数 [kou@localhost ~]$ cat size.txt | grep -c '1' 10 -n:显示匹配和行号