Question

So I'm using this

grep -lrai "search query" /right/here/

to search for a word in 100+ pdf files (which is why I have included -a).

Using grep shows 3 results, whereas a simple search in Spotlight will show a lot more in the same directory.

Am i doing something wrong here?

Was it helpful?

Solution

Using "-a" option does not magically convert PDF documents into plain text documents, unfortunately. If you need to grep search, you have to convert PDFs to text documents first (i.e. use this recipe: http://www.ehow.com/how_4794405_convert-pdf-word-document-mac.html).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top