open a libreoffice calc file directly from the terminal?

dajlano

New Member
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,
 


wizardfromoz

Administrator
Staff member
Gold Supporter
Credits
18,283
@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
 

dajlano

New Member
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
Credits
7,670
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!
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Members online


Latest posts

Top