命令格式:

grep pattern [file...]

When grep encounters a “pattern” in the file, it prints out the lines containing it.

也就是说,grep 命令的功能是,如果 file 中存在于 pattern 匹配的项,则输出。举例说明:

ls /bin /usr/bin | sort | uniq | grep zip

会得到如下结果:

bunzip2
bzip2
gunzip
gzip
unzip
zip
zipcloak
zipgrep
zipinfo
zipnote
zipsplit

相关文章:

  • 2021-11-27
  • 2021-08-15
  • 2022-12-23
  • 2021-07-22
  • 2022-12-23
  • 2021-12-13
  • 2022-12-23
猜你喜欢
  • 2021-09-14
  • 2021-08-17
  • 2022-12-23
  • 2022-12-23
  • 2022-01-15
相关资源
相似解决方案