简体   繁体   中英

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

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

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM