Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
Also, it's possible to get a list of applications that can be used to open a file (basically the inverse of this.)… – Anderson Green Oct 25 '12 at 2:27
up vote 2 down vote accepted

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:

share|improve this answer
This looks useful. How can I obtain the file extension for each file type? – Anderson Green Oct 25 '12 at 2:17
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 – Gerhard Burger Oct 25 '12 at 6:33
@AndersonGreen Some of the file associations are also stored in your home folder: ~/.local/share/applications/mimeapps.list. – Glutanimate Oct 26 '12 at 17:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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