Changing default applications on Linux

Get the MIME type of a file.

file --mime-type file.png -bL

Get the default applications of a MIME type.

xdg-mime query default image/png

Change the default applications of a MIME type.

xdg-mime default imv.desktop image/png

Note: xdg-mime will modify ~/.config/mimeapps.list. You can also edit this file manually.

Resources