6

I am on a debian 9 system with unknown desktop environment (ssh access). How can I find out which program is used by default to view a file with a given extension (e.g. pdf)?

Edit: Since extension is not important to the decision, the mime type of the given file can be found by using file

file -i file.ext
a1an
  • 301
  • 4
  • 10

1 Answers1

8

Ask xdg-mime.

$ xdg-mime query default application/pdf
atril.desktop
Ignacio Vazquez-Abrams
  • 44,857
  • 7
  • 93
  • 100