12

On Mac OS X there's a very handy command called textutil, that can be invoked from the terminal and allows to convert a document from a format to another; Sometimes I use it to convert a RTF file into HTML, but it's also able to convert doc, docx, odt and other formats.

I used to believe that it was a standard unix command, but I cannot find it and when I try to write sudo apt-get install textutil Ubuntu said that it have no idea of what textutil is... maybe I have searched in the wrong place for the command?

Do you know if something similar exists for Linux? I need to invoke that command from a script that will run on a linux server.

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
Cesco
  • 223
  • 2
  • 6

2 Answers2

11

GNU unrtf does almost exclusively what you want.

Pandoc can do a lot more.

4

unoconv can convert between OpenOffice.org document formats (ie. anything OOO can open).

Supported document formats include Open Document Format (.odt), MS Word (.doc), MS Office Open/MS OOXML (.xml), Portable Document Format (.pdf), HTML, XHTML, RTF, Docbook (.xml), and more.

I know it is in the Ubuntu repository, but you can get it from, and see more info at unoconv's homepage

Peter.O
  • 32,426
  • 28
  • 115
  • 163
  • `unoconv` is also in Debian. This is where Ubuntu got it from. So if you have `apt-get`, this will work on recent systems `sudo apt-get install unoconv`: – Christian Pietsch Jan 24 '14 at 12:05