Skip to content

Both.org

News, Opinion, Tutorials, and Community for Linux Users and SysAdmins

Primary Menu
  • About Us
  • Computers 101
    • Hardware 101
    • Operating Systems 101
  • End of 10 Events
    • Wake Forest, NC, — 2025-09-20
  • Linux
    • Why I use Linux
    • The real reason we use Linux
  • My Linux Books
    • systemd for Linux SysAdmins
    • Using and Administering Linux – Zero to SysAdmin: 2nd Edition
    • The Linux Philosophy for SysAdmins
    • Linux for Small Business Owners
    • Errata
      • Errata for The Linux Philosophy for SysAdmins
      • Errata for Using and Administering Linux — 1st Edition
      • Errata for Using and Administering Linux — 2nd Edition
  • Open Source Resources
    • What is Open Source?
    • What is Linux?
    • What is Open Source Software?
    • The Open Source Way
  • Write for us
    • Submission and Style guide
    • Advertising statement
  • Downloads
  • Home
  • Supercharge LibreOffice with Command Line Automation
  • Command Line
  • LibreOffice

Supercharge LibreOffice with Command Line Automation

Did you know that one of LibreOffice's powers is the ability to operate from the command line like converting documents from one format to another?
Don Watkins January 22, 2024 4 minutes read
A small portion of LibreOffice Command Line Help

LibreOffice has all the productivity features you’d want from an office software suite, making it a popular open source alternative to Microsoft Office or Google Suite. One of LibreOffice’s powers is the ability to operate from the command line. For example, Seth Kenlon recently explained how he uses a global command-line option to convert multiple files from DOCX to EPUB with LibreOffice. His article inspired me to share some other LibreOffice command-line tips and tricks.

Before we look at some hidden features of LibreOffice commands, you need to understand how to use options with applications. Not all applications accept options (aside from the basics like the --help option, which works in most Linux applications).

$ libreoffice --help

This returns descriptions of other options LibreOffice accepts. Some applications don’t have many options, but LibreOffice has a few screens worth, so there’s plenty to play with.

Here are five useful things you can do with LibreOffice at the terminal to make the software even more useful.

1. Customize your launch options

You can modify how you launch LibreOffice. For instance, if you want to open just LibreOffice’s word processor component:

$ libreoffice --writer  #starts the word processor

You can open its other components similarly:

$ libreoffice --calc  #starts the Calc document
$ libreoffice --draw  #starts an empty Draw document
$ libreoffice --web  #starts and empty HTML document

You also can access specific help files from the command line:

$ libreoffice --helpwriter
LibreOffice Writer help

Or if you need help with the spreadsheet application:

$ libreoffice --helpcalc

You can start LibreOffice without the splash screen:

$ libreoffice --writer --nologo

You can even have it launch minimized in the background while you finish working in your current window:

$ libreoffice --writer --minimized

2. Open a file in read-only mode

You can open files in read-only mode using --view to prevent accidentally making and saving changes to an important file:

$ libreoffice --view example.odt

3. Open a document as a template

Have you ever created a document to use as a letterhead or invoice form? LibreOffice has a rich built-in template system, but you can make any document a template with the -n option:

$ libreoffice --writer -n example.odt

Your document will open in LibreOffice and you can make changes to it, but you won’t overwrite the original file when you save it.

4. Convert documents

When you need to do a small task like converting a file to a new format, it can take as long for the application to launch as it takes to do the task. The solution is the --headless option, which executes LibreOffice processes without launching the graphical user interface.

For example, converting a document to EPUB is a pretty simple task in LibreOffice—but it’s even easier with the libreoffice command:

$ libreoffice --headless --convert-to epub example.odt

Using wildcards means you can convert dozens of documents at once:

$ libreoffice --headless --convert-to epub *.odt

You can convert files to several formats, including PDF, HTML, DOC, DOCX, EPUB, plain text, and many more.

5. Print from the terminal

You can print LibreOffice documents from the command line without opening the application:

$ libreoffice --headless -p example.odt

This option prints to the default printer without opening LibreOffice; it just sends the document to your printer.

To print all the files in a directory:

$ libreoffice -p *.odt

(More than once, I’ve issued this command and then run out of paper, so make sure you have enough paper loaded in your printer before you start.)

You can also print files to PDF. There’s usually no difference between this and using the --convert-to-pdf option but it’s easy to remember:

$ libreoffice --print-to-file example.odt --headless

Bonus: Flatpak and command options

If you installed LibreOffice as a Flatpak, all of these command options work, but you have to pass them through Flatpak. Here’s an example:

$ flatpak run org.libreoffice.LibreOffice --writer

It’s a lot more verbose than a local install, so you might be inspired to write a Bash alias to make it easier to interact with LibreOffice directly.

Surprising terminal options

Find out how you can extend the power of LibreOffice from the command line by consulting the man pages:

$ man libreoffice

Were you aware that LibreOffice had such a rich set of command-line options? Have you discovered other options that nobody else seems to know about? Share them — send an email to Open@Botrh.org and we’ll collect them into a follow-up article.

Tags: LibreOffice

Post navigation

Previous: My favorite Git tools
Next: How I use cron in Linux

Related Stories

command_line_prompt
  • Command Line
  • Linux
  • Programming

Writing a replacement seq command

Jim Hall April 27, 2026
BUSINESS_twoforward
  • Fun
  • LibreOffice

Is there a better Pi Day than March 14?

Jim Hall March 14, 2026
files_documents_paper_folder
  • Command Line
  • Linux 101

Getting Started With the cd Command

David Both February 11, 2026

System upgrades this Sunday, May 3

Tools illustrationFedora 44 was released this week and I’ve upgraded all my systems except for the two that directly affect Both.org. I’ll be upgrading the hosts for my server and firewall to Fedora 44 this Sunday afternoon, May 3.

Both.org will be down for most of the afternoon for these upgrades.

Thanks for your patience.

Random Quote

The fastest algorithm can frequently be replaced by one that is almost as fast and much easier to understand.

— Douglas W. Jones

Why I’ve Never Used Windows

On February 12 I gave a presentation at the Triangle Linux Users Group (TriLUG) about why I use Linux and why I’ve never used Windows.

Here’s the link to the video: https://www.youtube.com/live/uCK_haOXPFM 

Why there’s no such thing as AI

Last October at All Things Open (ATO) I was interviewed by Jason Hibbits of We Love Open Source. It’s posted in the article “Why today’s AI isn’t intelligent (yet)“.

Technically We Write — Our Partner Site

Our partner site, Technically We Write, has published a number of articles from several contributors to Both.org. Check them out.

Technically We Write is a community of technical writers, technical editors, copyeditors, web content writers, and all other roles in technical communication.

Subscribe to Both.org

To comment on articles, you must have an account.

Send your desired user ID, first and last name, and an email address for login (this must be the same email address used to register) to subscribe@both.org with “Subscribe” as the subject line.

You’ll receive a confirmation of your subscription with your initial password as soon as we are able to process it.

Administration

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

License and AI Statements

Both.org aims to publish everything under a Creative Commons Attribution ShareAlike license. Some items may be published under a different license. You are responsible to verify permissions before reusing content from this website.

The opinions expressed are those of the individual authors, not Both.org.

You may not use this content to train AI.

 

Advertising Statement

Both.org does not sell advertising on this website.


Advertising may keep most websites running—but at Both.org, we’re committed to keeping our corner of the web ad-free. Both.org does not sell advertising on the website. Nor do we offer sponsored articles at this time. We’ll update this page if our position on sponsorships changes.

We want to be open about how the website is funded. Both.org is supported entirely by David Both and a few other dedicated individuals.

 

 

Copyright © All rights reserved. | MoreNews by AF themes.