看板 Linux 關於我們 聯絡資訊
請問可以用什麼指令所以查詢特定資料夾裡面所以文字檔的特定字呢? 而文字檔有可能有txt, 或者沒有副檔名, 然後也可以查pdf file. -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.34.220.192 ※ 文章網址: https://www.ptt.cc/bbs/Linux/M.1529384918.A.B21.html
kenduest: 一般文字檔案,很常見基本的 grep 可以搜尋檢索 06/19 13:36
kenduest: pdf 檔案,請搭配 pdftotext 這類工具,使用 find 06/19 13:36
kenduest: 搜尋 pdf 檔案時候用呼叫該工具檢索搜尋可以達成需求 06/19 13:36
Gold740716: pdf 可以用 pdfgrep 06/19 13:51
Gold740716: 純文字就 grep string * 06/19 13:51
noonee: grep -irn "string" ./*str1*/*str2* 06/19 14:16