• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

libreoffice Command Examples in Linux

by Deepika

LibreOffice is a free and open-source office suite, which includes programs for word processing, spreadsheets, presentations, graphics, and databases. The command line interface (CLI) for LibreOffice allows users to perform various tasks, such as converting documents to different formats, automating tasks, and scripting.

The basic syntax for using the LibreOffice CLI is “libreoffice [options] [file]”, where options specify the desired action and file is the path to the document you want to work with. For example, the command “libreoffice –headless –convert-to pdf file.docx” will convert a Word document to a PDF in headless mode (meaning without opening the LibreOffice GUI).

Some common options for the LibreOffice CLI include:

  • –headless: runs LibreOffice in the background without opening the GUI
  • –convert-to: converts a document to a specified format
  • –print-to-file: prints a document to a file
  • –invisible: runs LibreOffice without showing the GUI
  • –nologo: suppresses the display of the logo when starting LibreOffice.

It’s worth noting that in addition to these basic options, LibreOffice also provides advanced options like –writer, –calc, –impress, and –draw that allow you to launch the specific module of LibreOffice, and also advanced command line options like –accept= and –infilter= that allow you to set up the connection to a remote server and the filter options respectively.

libreoffice Command Examples

1. Open a space-separated list of files in read-only mode:

# libreoffice --view path/to/file1 path/to/file2

2. Display the content of specific files:

# libreoffice --cat path/to/file1 path/to/file2

3. Print files to a specific printer:

# libreoffice --pt printer_name path/to/file1 path/to/file2

4. Convert all `.doc` files in current directory to PDF:

# libreoffice --convert-to pdf *.doc

Filed Under: Linux

Some more articles you might also be interested in …

  1. alias: command not found
  2. How to Change or Rename a Mount Point in Linux
  3. How to Switch Password Algorithm on CentOS/RHEL
  4. reboot Command Examples in Linux
  5. physlock Command Examples in Linux
  6. nslookup Command Examples in Linux
  7. “comm” Command in Linux with Examples
  8. How to schedule Jobs with Cron in Linux
  9. How to Capture More Logs in /var/log/dmesg for CentOS/RHEL
  10. CentOS / RHEL 6 : How to list or install only security updates with yum

You May Also Like

Primary Sidebar

Recent Posts

  • powertop Command Examples in Linux
  • powertop: command not found
  • powerstat: command not found
  • powerstat Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright