5

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?

1

1 Answer 1

3

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
3
  • This looks useful. How can I obtain the file extension for each file type? Oct 25, 2012 at 2:17
  • 1
    The application to open is not determined by the extension but by the mimetype, like text/html. Doing cat /usr/share/applications/defaults.list will get you many file types. Also have a look at Ubuntu Tweak which is great for viewing adding file type associations Oct 25, 2012 at 6:33
  • 1
    @AndersonGreen Some of the file associations are also stored in your home folder: ~/.local/share/applications/mimeapps.list. Oct 26, 2012 at 17:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .