Matching Control

-i :Ignore case 忽略大小写
linux三剑客之grep

-w:whole words 按照整个单词匹配
linux三剑客之grep

-v:Invert the sense of matching, to select non-matching lines 匹配不包含指定关键字的行
linux三剑客之grep

Output Line Prefix Control

-n:line number 在行前显示行号
linux三剑客之grep

Context Line Control

-A NUM:Print NUM lines of trailing context after matching lines. 显示关键字所在行的后NUM行

-B NUM:Print NUM lines of leading context before matching lines. 显示关键字所在行的前NUM行

-C NUM:Print NUM lines of output context 显示关键字前后NUM行
linux三剑客之grep

General Output Control

-c :print a count of matching lines 打印匹配关键在所在行的个数
linux三剑客之grep

相关文章:

  • 2022-12-23
  • 2021-06-28
  • 2022-01-25
  • 2021-11-13
  • 2021-10-27
  • 2021-09-20
  • 2022-12-23
  • 2022-02-28
猜你喜欢
  • 2021-12-20
  • 2021-07-23
  • 2021-10-29
  • 2021-11-27
  • 2022-01-11
相关资源
相似解决方案