Ubuntu – Get a list of file types that can be opened with a specific application

bash

In Ubuntu, is there any way to obtain a list of file types that can be opened with a specific application? For example, I'd like to find a list of all files that can be opened with the program google-chrome. Is it possible to do this using a shell script?

Best Answer

You can take a look in /usr/share/applications/defaults.list to see a list of file types and their associated apps.

For a specific app, type this into your terminal:

grep "google-chrome" /usr/share/applications/defaults.list

You'll see something like this:

text/html=firefox.desktop;google-chrome.desktop
text/xml=firefox.desktop;google-chrome.desktop
application/xhtml_xml=google-chrome.desktop
x-scheme-handler/http=firefox.desktop;google-chrome.desktop
x-scheme-handler/https=firefox.desktop;google-chrome.desktop
x-scheme-handler/ftp=google-chrome.desktop
Related Question