Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I find out the default applications on Linux - CentOS/Ubuntu - using the command line?

Tags:

linux

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:

  • This is the default browser
  • This is the default mail client
  • This is the default office suite
  • This is the default antivirus
  • This is the default firewall
  • This is the default antispyware
like image 635
Neagu V Avatar asked Oct 16 '25 14:10

Neagu V


1 Answers

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.

like image 112
Julien Lopez Avatar answered Oct 18 '25 08:10

Julien Lopez



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!