Mime

From Blue-IT.org Wiki

Revision as of 19:53, 8 January 2012 by Apos (talk | contribs)

Mime types under Linux

$> man  xdg-mime
xdg-mime - command line tool for querying information about file type handling and adding descriptions for new file types
[...]
$> man  xdg-open
xdg-open - opens a file or URL in the user's preferred application
[...]

You can open any file with the desired program and the xdg-open command:

$> xdg-open special_file.pdf

Setting the default type is easy:

xdg-mime default
$> xdg-mime query default application/pdf
AdobeReader.desktop

$> xdg-mime default kde-kpdf.desktop application/pdf

$> xdg-mime query default application/pdf
kde-kpdf.desktop