This question already has an answer here:

Code which works with a single document

pdftotext *.pdf - | grep therapy

You can use find as described in the thread How can I grep in PDF files? but I would like to understand why the above command is not working.

Differential code where pdfgrep may add some benefit but still early in development

pdftotext *.pdf - | pdfgrep therapy
#Wrong syntax so error
# Usage: pdfgrep [OPTION]... PATTERN FILE...
# Syntax Warning: Invalid Font Weight
# Syntax Warning: Invalid Font Weight

I would like to get then a fast way to move to the specific pdf page if there is a good match. However, I have not found any evidence that such a feature exists.

OS: Debian 8.5
Linux kernel: 4.6 backports
Hardware: Asus Zenbook UX303UA
Poppler-utils: pdftotext

marked as duplicate by Stephen Kitt, countermode, techraf, GAD3R, Anthony Geoghegan Oct 20 '16 at 10:22

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


Just use pdfgrep directly:

pdfgrep -n therapy *.pdf

The -n option will display the page number of each match.


you could try this;

pdfgrep therapy *.pdf


find /tmp -name '*.pdf' -exec pdfgrep test {} +


user@host $ pdfgrep test *.pdf 
test (copy).pdf:test1
test (copy).pdf:test2
test (copy).pdf:test3

user@host $ find /tmp -name '*.pdf' -exec pdfgrep test {} +
/tmp/test (copy).pdf:test1
/tmp/test (copy).pdf:test2
/tmp/test (copy).pdf:test3

Not the answer you're looking for? Browse other questions tagged or ask your own question.