open a libreoffice calc file directly from the terminal?

dajlano

New Member
Joined
Jan 7, 2021
Messages
17
Reaction score
5
Credits
180
Hi everybody. I'm just very recently starting to get some very basic experience with the terminal and it's very exciting!! I'm trying to use it more so that I can get more experience. Is there a way I can use the terminal to open a file (in this case, a libreoffice .ods spreadsheet file)? this way, i wouldn't need to go into any of the folder windows. thank you,
 


/path/to/bin/oocalc /path/to/myfile.ods
 
@dos2unix that looks suspiciously like a reference to Open Office, is that so?

A simple alternative is

Code:
libreoffice --calc /path/to/myfile.ods

That's a double dash before calc

Cheers

Wizard
 
strange, when I run this, nothing happens. I get no error or anything, but the file doesn't open either. i made sure to change the path/to to my specific folders etc. and I changed the "myfile" to the actual name of my file obviously. i could be missing something obvious because I'm still a big time beginner
 
if you are using version 7.1 the command is
Code:
libreoffice7.1 --calc /path to file.ods
or for Writer
Code:
libreoffice7.1 --writer /path to file.odt
 
Or perhaps use xdg-open.
e.g.
Bash:
xdg-open /path/to/document.ods

xdg-open opens the specified document using the default program for that mime-type. It might not be installed by default, so you might need to install it before you can use it.
I have xdg-open aliased to xo in my .bashrc like this:
Bash:
alias xo='xdg-open'

So I can use:
Bash:
xo /path/to/file
Which saves a bit of typing!
 
@dos2unix that looks suspiciously like a reference to Open Office, is that so?

No.

rpm -ql libreoffice-calc | grep bin
/usr/bin/oocalc

But you have me wondering if it is a distro specific thing?
 

Staff online

Members online


Top