How to Read OpenOffice / LibreOffice Files from the Command Line

Let’s say you have edited a file in LibreOffice Writer, but later you access your computer remotely via SSH for example. You don’t really want to bother copying the file to your current machine, and rather just quickly check its content in the terminal. Is there a way?

OpenOffice_Terminal
Since odt files are just some zip files containing XML files, you could manually decompress the file, and open XML files, but there is a more convenient the program is called odt2txt. On an Ubuntu / Debian machine it can be installed with:


For basic usage, you just need to pass the filename as parameter:


But there are also a few more options:

This also wrote with ods (spreadsheets) and odp (presentations) files with ods2txt and odp2txt which are just symlinks pointing to the same program as odt2txt, namely odt2txt.odt2txt.

Share this:

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

ROCK Pi 4C Plus
Subscribe
Notify of
guest
The comment form collects your name, email and content to allow us keep track of the comments placed on the website. Please read and accept our website Terms and Privacy Policy to post a comment.
2 Comments
oldest
newest
onebir
onebir
9 years ago

Openoffice has a headless mode too – not sure exactly what you can do with it: $ soffice –help LibreOffice 4.2.7.2 420m0(Build:2) Usage: soffice [options] [documents…] Options: –minimized keep startup bitmap minimized. –invisible no startup screen, no default document and no UI. –norestore suppress restart/restore after fatal errors. –quickstart starts the quickstart service –nologo don’t show startup screen. –nolockcheck don’t check for remote instances using the installation –nodefault don’t start with an empty document –headless like invisible but no userinteraction at all. –help/-h/-? show this message and exit. –version display the version information. –writer create new text document. –calc create… Read more »

Khadas VIM4 SBC