Sunday, May 5, 2024
45
rated 0 times [  45] [ 0]  / answers: 1 / hits: 62252  / 1 Year ago, mon, may 8, 2023, 9:38:43

How can I run LibreOffice Writer from the command line? Basically, what is its command and how do I get to know what's the command to run a particular application in general?


More From » command-line

 Answers
6

Run libreoffice --writer to start LibreOffice Writer.



In this case, I guessed that it might be libreoffice or similar, so I entered libre in a terminal and pressed tab twice. libreoffice was one of the options, so I ran that. It started something from which one could choose to go to Writer, Calc, Impress, etc. Since you asked specifically about Writer, I looked at man libreoffice, which mentions -writer as one of the command line options. Running libreoffice -writer worked but resulted in



$ libreoffice -writer
Warning: -writer is deprecated. Use --writer instead.


And so I got to libreoffice --writer.



In general, one could try things like the following:




  • Guess and try names, based on the name of the application. Use Tab-completion for help. Read man pages for options.

  • Run the program (using a GUI menu or however else you run it), guess the process name, and check using ps aux | grep guessed_name.

  • If you know that the program belongs to installed package X, run dpkg -L X. It will list installed files from package X, look for /usr/bin, /bin, /sbin, etc in the output.

  • One can find out the process corresponding to a window as follows :



    Run xprop _NET_WM_PID, navigate to the target window (without clicking!), and click on it. This will print the PID corresponding to the window, for example



    _NET_WM_PID(CARDINAL) = 7394


    Now run ps -p 7394 (with 7394 replaced by the PID you got) to find out the process name for the given PID.



[#41936] Wednesday, May 10, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
antebrow

Total Points: 291
Total Questions: 135
Total Answers: 117

Location: New Caledonia
Member since Thu, Mar 23, 2023
1 Year ago
antebrow questions
;