5 surprising things you can do with LibreOffice from the command line
======
Convert, print, protect, and do more with your files directly from the
command line.
![hot keys for shortcuts or features on computer keyboard][1]
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][2] from DOCX to EPUB with LibreOffice. His article inspired me to share some other LibreOffice command-line tips and tricks.
Before welook 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.
That said, 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][3]
(Don Watkins, [CC BY-SA 4.0][4])
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 andyou 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:
If you installed LibreOffice as a [Flatpak][5], 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][6] 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 in the comments!
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/shortcut_command_function_editing_key.png?itok=a0sEc5vo (hot keys for shortcuts or features on computer keyboard)