Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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 command-line tool to text-search a docx file? I tried grep, but it doesn't work with docx even though it works fine with txt and xml files. I could convert the docx to txt first, but I'd prefer a tool that operates directly on docx files. I need the tool to work under Cygwin.

OP edit: Later I found out that the easiest way to achieve the grep is actually to convert those docx to txt then grep over them.

share|improve this question
Related stackoverflow answer. – jw013 Jan 6 '12 at 20:24
I got rid of the DOS part, since that's off-topic here – Michael Mrozek Jan 6 '12 at 21:15
Related: Command-line-friendly full-text indexing? – Gilles Jan 7 '12 at 0:11

I know of several indexing tools that support Word documents. Such tools allow you to index documents, then efficiently search words in the index. They don't permit full text searches.

share|improve this answer

DOCx is compressed and it is not a text format. So what you need is a converter first. After that you can use the find command on the converted file(s).

share|improve this answer
Or you can use a search tool that can read inside compressed files. In your last sentence, I suppose you meant grep? – Gilles Jan 6 '12 at 23:32
@Gilles - look at the original title of the question before Michael edited it. This seemed to be a question about DOS (and I flagged it off-topic). – Nils Jan 7 '12 at 20:14

Have you looked at openoffice ninja?
(don't know about cygwin support)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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