Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a grep/ack/grin-like tool for all filetypes (including MS Office, PDF, etc)? I frequently find myself wanting to search a folder or an entire disk for strings inside files that are more than just plaintext.

I'm particularly interested in OSX solutions, though interested in cross platform and, to a lesser extent, UNIX/Windows solutions as well.


share|improve this question
Just to clarify, you want a tool that can open a file type, i.e pdf then search the text inside the file type, i.e. pdf and include its results to the final result set. You do not want to search the pdf as raw data? Nice! – Guy Coder Mar 29 '12 at 19:51
Are all of your needed file types here?… – Guy Coder Mar 29 '12 at 20:02
Yep, they sure are. Are you suggesting that Google can index my Mac? – user72923 Mar 30 '12 at 2:24
up vote 1 down vote accepted

Since all of your needed filetypes are here and Google Desktop has been discontinued I would try Desktop Search Engines or look for a download site that still offers Google Desktop such as CNET

share|improve this answer

I don't know of a single utility that will handle everything, but some useful options are:

  1. strings (from the binutils package)
  2. lesspipe (from the less package)
  3. antiword
  4. odt2txt
  5. pdftotext (from poppler-utils)

Anything else, and you'll probably need to run /usr/bin/file and see if you can find a package that will let you convert to some canonical format that you know how to deal with.

share|improve this answer
See comments above for clarification. Looking primarily for common filetypes like MS Office and PDF. – user72923 Mar 30 '12 at 2:31

No, the set of all filetypes and text-encodings is too large for a single program to be able to parse them all.

Consider for example

  • Amiga Noisetracker mod file format (contains instrument names etc)
  • IBM VSAM file containing EBCDIC?
  • OS/2 Lotus Notes file (encrypted)
share|improve this answer
What about major filetypes like those listed by Guy Coder in the comments? Do you know of a tool that neatly handles these filetypes? MS Office and PDF are the main priorities. – user72923 Mar 30 '12 at 2:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .