4

I've had success opening files from the command line if I know the program used to view the file. If I need to open a .pdf I can call evince filename. What do you do if you don't know which program name opens a certain file type? Say I have a powerpoint slides I want to open? Is there a generic way in elementary OS freya to open files similar to Mac's open command?

If you need a specific program name to open various types of files, is there a way on the command line to figure out what program will run what file type?

1 Answer 1

7

Yes there is, it's called xdg-open and should be installed by default.

You can read more about it in ArchWiki:

xdg-open is a desktop-independent tool for configuring the default applications of a user. Many applications invoke the xdg-open command internally.

Inside a desktop environments like GNOME, KDE, or Xfce), xdg-open simply passes the arguments to those desktop environment's file-opener application (eg. gvfs-open, kde-open, or exo-open). which means that the associations are left up to the desktop environment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.