Difference between revisions of "Mime"

From Blue-IT.org Wiki

(Mime types under Linux)
Line 22: Line 22:
 
  $> xdg-mime query default application/pdf
 
  $> xdg-mime query default application/pdf
 
  kde-kpdf.desktop
 
  kde-kpdf.desktop
 +
 +
 +
[[Category:Ubuntu]]

Revision as of 19:53, 8 January 2012

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