open a libreoffice calc file directly from the terminal?

dajlano

New Member
Joined
Jan 7, 2021
Messages
15
Reaction score
5
Credits
161
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,
 


dos2unix

Well-Known Member
Joined
May 3, 2019
Messages
1,010
Reaction score
689
Credits
5,096
/path/to/bin/oocalc /path/to/myfile.ods
 

wizardfromoz

Administrator
Staff member
Gold Supporter
Joined
Apr 30, 2017
Messages
6,615
Reaction score
5,370
Credits
19,540
@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
 
OP
D

dajlano

New Member
Joined
Jan 7, 2021
Messages
15
Reaction score
5
Credits
161
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
 

JasKinasis

Well-Known Member
Joined
Apr 25, 2017
Messages
1,318
Reaction score
1,870
Credits
8,314
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

Well-Known Member
Joined
May 3, 2019
Messages
1,010
Reaction score
689
Credits
5,096
@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?
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Members online


Top