Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the five tips for operating LibreOffice on the command line?

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces you five command line operation LibreOffice skills, the content is very detailed, interested friends can refer to, hope to be helpful to you.

Convert, print, protect and other operations on the file directly on the command line.

LibreOffice has all the productivity features of the office suite you want, making it a popular open source alternative to Microsoft Office or Google Suite. One of the capabilities of LibreOffice is that it can operate from the command line. For example, Seth Kenlon recently explained how to use LibreOffice to convert multiple files from DOCX to EPUB with global command-line options. His article inspired me to share some other LibreOffice command-line tips and tricks.

Before you look at some of the hidden features of the LibreOffice command, you need to know how to use the application options. Not all applications accept options (except for basic options such as the-- help option, which can be used in most Linux applications).

$libreoffice-help

This returns a description of the other options accepted by LibreOffice. Some apps don't have many options, but LibreOffice has several pages of useful options, so there are a lot of things to play with.

That is, you can use LibreOffice on the terminal to do the following five useful operations to make the software more useful.

1. Customize your startup options

You can modify the way you start LibreOffice. For example, if you want to open only the word processor component of LibreOffice:

$libreoffice-writer # starts the word processor

You can similarly open its other components:

$libreoffice-- calc # launch an empty spreadsheet $libreoffice-- draw # launch an empty drawing document $libreoffice-- web # launch an empty HTML document

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

$libreoffice-helpwriter

LibreOffice Writer help

Or if you need help with spreadsheet applications:

$libreoffice-helpcalc

You can start LibreOffice without displaying the startup screen:

$libreoffice-writer-nologo

You can even minimize startup in the background when you finish working on the current window:

$libreoffice-- writer-- minimized2, open a file in read-only mode

You can use-- view to open files in read-only mode to prevent accidental changes and saves to important files:

$libreoffice-- view example.odt3, open a template document

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

$libreoffice-- writer-n example.odt

Your document will be opened in LibreOffice and you can modify it, but the original file will not be overwritten when saved.

4. Convert the document

When you need to do a small task, such as converting a file to a new format, the application may take as long to start as it takes to complete the task. The workaround is the-- headless option, which executes the LibreOffice process without starting the graphical user interface.

For example, in LibreOffic, converting a document to EPUB is a very simple task, but it is easier to use the libreoffice command:

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

Using wildcards means you can convert dozens of documents at a time:

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

You can convert files to a variety of formats, including PDF, HTML, DOC, DOCX, EPUB, plain text, etc.

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 does not need to turn on LibreOffice to print using the default printer, it just sends the document to your printer.

To print all the files in a directory:

$libreoffice-p * .odt

I executed this command more than once, and then ran out of paper, so before you start, make sure you have enough paper in your printer. )

You can also export the file to PDF. Usually this is no different from using the-- convert-to-pdf option, but it's easy to remember:

$libreoffice-- print-to-file example.odt-- headless extra tips: Flatpak and command options

If you are using Flatpak to install LibreOffice, all of these command options are available, but you must pass them through Flatpak. Here is an example:

$flatpak run org.libreoffice.LibreOffice-writer

It is much more troublesome than a local installation, so you may be inspired to write a Bash alias to make it easier to interact directly with LibreOffice.

Amazing terminal options

Check out the manual page to learn how to extend the functionality of LibreOffice from the command line:

Man libreoffice on the five command line operating LibreOffice skills are shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report