1 2 3 4 5
#!/bin/bash # Print xdg file type and the default opener for a file filetype=$(xdg-mime query filetype "$1") echo $filetype=`xdg-mime query default "$filetype"`