The file command
can be used on a Linux
system to determine what type of data a file holds, e.g.,
file Untitled.png. You can determine the
media type, aka
MIME type, by using
the --mime-type option for the file command. E.g.,
file --mime-type Untitled.png. You can determine which application
is the default application for opening files of that
file type using the
xdg-mime
command — the
xdg-mime program is a command line tool that can be used to determine
what application handles a particular file type. E.g., xdg-mime
query default image/png — you need to specify the filetype
in the "minor/major" format that xdg-mime expects, which is what you see
in the output of the file --mime-type command.
$ file Documents/Untitled.png Documents/Untitled.png: PNG image data, 597 x 113, 8-bit/color RGBA, non-interlaced $ file Documents/tea.html Documents/tea.html: ASCII text, with very long lines (6229) $ file --mime-type Documents/Untitled.png Documents/Untitled.png: image/png $ xdg-mime query default image/png org.gnome.Loupe.desktop $ file --mime-type Documents/Cocoa-Lead.odt Documents/Cocoa-Lead.odt: application/vnd.oasis.opendocument.text $ xdg-mime query default application/vnd.oasis.opendocument.text libreoffice-writer.desktop $
The default file
manager for Ubuntu
Linux is GNOME Files.
You can make another application the default file manager, if you like.
Some alternatives are
Thunar,
Nemo,
Krusader, or
Dolphin.
You can determine which application is the default file manager with the
command xdg-mime query default inode/directory. You can set
the default file manager with the command xdg-mime default
fmgr.desktop where fmgr is the filemanager you wish to
use.
[ More Info ]
