Examples (4)
Display the MIME type of a file
xdg-mime query filetype path/to/fileDisplay the default application for opening PNGs
xdg-mime query default image/pngDisplay the default application for opening a specific file
xdg-mime query default $(xdg-mime query filetype path/to/file)Set imv as the default application for opening PNG and JPEG images
xdg-mime default imv.desktop image/png image/jpegmade by @shridhargupta | data from tldr-pages