0

How to open files without default application using xdg-open file_name? xdg-open file_name opens the file in default application. To play video files, it always opens with vlc which is set to default. If I want to open with media player, what will be the xdg-open code?

  • Just a side note, since it's already been answered that xdg-open will only open the default application for the file type. Check out manpages.ubuntu.com/manpages/cosmic/man1/xdg-open.1.html especially the links to xdg-mime and xdg-settings for info on how to list the default types and change them from the command line. – SudoSURoot Jul 4 '18 at 5:47
2

If you want to open a file with a specific application, use that application's command directly instead of xdg-open. xdg-open's purpose is to open the file with the associated application.

For example, with the default media player, Totem, the command is totem, so you'd do:

totem path/to/file.avi

If you want to use mplayer, do:

mplayer path/to/file.avi

and so on.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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