How to search contents of multiple pdf files?

后端 未结 13 1172
误落风尘
误落风尘 2020-11-30 15:58

How could I search the contents of PDF files in a directory/subdirectory? I am looking for some command line tools. It seems that grep can\'t search PDF files.<

13条回答
  •  情话喂你
    2020-11-30 16:48

    First convert all your pdf files to text files:

    for file in *.pdf;do pdftotext "$file"; done
    

    Then use grep as normal. This is especially good as it is fast when you have multiple queries and a lot of PDF files.

提交回复
热议问题