shell命令, 在目录中搜索关键词匹配的文件


问题描述

需要在目录中,查找含某个关键词的所有文件.

解决方法

直接使用grep -rl.

$ grep -rl "regelhh@gmail.com" /path/to/itaken.github.io
/path/to/itaken.github.io/_config.yml
...
/path/to/itaken.github.io/_posts/201703/2017-03-18-vue2创建todolist.md
/path/to/itaken.github.io/_posts/201703/2017-03-09-创建vue项目.md

参考文档


Author: Itaken
Reprint policy: All articles in this blog are used except for special statements CC BY 4.0 reprint polocy. If reproduced, please indicate source Itaken !
  TOC目录