How can I find out the default applications on Linux - CentOS/Ubuntu - using the command line?
I tried to use xdg-mime
and read the environment variables using printenv
, but no result. I just need a command to tell me:
You should find what you are looking for in /usr/share/applications/defaults.list
and/or ~/.local/share/applications/mimeinfo.cache
.
For example, I have:
-> cat /usr/share/applications/defaults.list | grep mailto
x-scheme-handler/mailto=thunderbird.desktop
-> cat /usr/share/applications/defaults.list | grep http
x-scheme-handler/http=firefox.desktop;google-chrome.desktop
x-scheme-handler/https=firefox.desktop;google-chrome.desktop
Note that what is defined in the mime
files of your home directory have priority over the ones in /usr/share/applications
.
You can also use xdg-mime
:
-> xdg-mime query default text/x-c
emacs24.desktop
-> xdg-mime query default x-scheme-handler/http
exo-web-browser.desktop
If you also have exo-something.desktop
(xfce), you can check what it is with exo-preferred-applications
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With