Domanda

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?

È stato utile?

Soluzione

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).

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top