Comments on How to Open Files in Default Desktop Application from Command-Line on Ubuntu

What do you do when you want to open a PDF file in Ubuntu? Simple, double click on the PDF file icon, or right-click and select the "Open with Document Viewer" option. But what if you're asked to do the same task through the command line? Do you know the command line utility that will do the job for you? However, you'll be glad to know that there's way through which you can launch Evince for a PDF file, even if you don't know the fact that a command line utility of that name exists, and that's what we'll be discussing in this article.

6 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: 1235

firefox pdf.file &

By: Richard Fuhr

When using gnome-open to open a directory, as in gnome-open . I see the following error messages, and, in fact, I see the same error messages when invoking nautilus ..  What is causing this to happen?  Despite the error messages, both gnome-open . and nautilus . do open the requested (in this case the working) directory.

By: Videonauth

You could as well use the vanilla in ubuntu delivered pdf viewer evince:

evince file.pdf

By: HEY HEY IM HERE!

But what if the evince command doesn't work?? Like it's not working on mine! :(

pls someone help this stressed human being trying to open a .pdf file!!!!!! PLEASE!

By: Daniel

What is wrong with using <kbd>xdg-open [path]</kbd>? It’s instaled by default just about everywhere and will open any file in it’s default desktop program.

By: Guess

xdg-open !!!

It's working with any GUI, not only GNOME and doesn't need extra package!