作者allenhw (Pororo)
看板Linux
标题[问题] 要如何查资料夹所有文件档里面的特定字
时间Tue Jun 19 13:08:35 2018
请问可以用什麽指令所以查询特定资料夹里面所以文字档的特定字呢?
而文字档有可能有txt, 或者没有副档名,
然後也可以查pdf file.
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 114.34.220.192
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Linux/M.1529384918.A.B21.html
1F:→ kenduest: 一般文字档案,很常见基本的 grep 可以搜寻检索 06/19 13:36
2F:→ kenduest: pdf 档案,请搭配 pdftotext 这类工具,使用 find 06/19 13:36
3F:→ kenduest: 搜寻 pdf 档案时候用呼叫该工具检索搜寻可以达成需求 06/19 13:36
4F:推 Gold740716: pdf 可以用 pdfgrep 06/19 13:51
5F:→ Gold740716: 纯文字就 grep string * 06/19 13:51
6F:→ noonee: grep -irn "string" ./*str1*/*str2* 06/19 14:16