Show output of all rules that match the file.
TODO: this method now just returns one match for each method (globs, magic, etc.).
|<B>-bB>, <B>--briefB>||Do not prepend filenames to output lines (brief mode).|
|<B>--databaseB>=mimedir:mimedir:...||Force the program to look in these directories for the shared mime-info database. The directories specified by the basedir specification are ignored.|
|<B>-dB>, <B>--describeB>||Print file descriptions instead of mime types, this is the default when using --file-compat.|
|<B>-DB>, <B>--debugB>||Print debug information about how the mimetype was determined.|
|<B>-fB> namefile, <B>--namefileB>=namefile||Read the names of the files to be examined from the file namefile (one per line) before the argument list.|
Make mimetype behave a little more file(1) compatible. This
is turned on automatically when you call mimetype by a link
A single - wont be considered a separator between options and filenames anymore, but becomes identical to --stdin. ( You can still use -- as separator, but that is not backward compatible with the original file command. ) Also the default becomes to print descriptions instead of mimetypes.
|<B>-FB> string, <B>--separatorB>=string||Use string as custom separator between the file name and its mimetype or description, defaults to : .|
|<B>-uB>, <B>--usageB>||Print a help message and exits.|
|<B>-iB>, <B>--mimetypeB>||Use mime types, opposite to --describe, this is the default when _not_ using --file-compat.|
|<B>-LB>, <B>--dereferenceB>||Follow symbolic links.|
|<B>-lB> code, <B>--languageB>=code||The language attribute specifies a two letter language code, this makes descriptions being outputted in the specified language.|
|<B>-MB>, <B>--magic-onlyB>||Do not check for extensions, globs or inode type, only look at the content of the file. This is particularly useful if for some reason you dont trust the name or the extension a file has.|
|<B>-NB>, <B>--noalignB>||Do not align output fields.|
If you want an alternative output format, you can specify a format string
containing the following escapes:
Alignment is not available when using this, you need to post-process the output to do that.
Determine type of content from STDIN, less powerful then normal file checking
because it only uses magic typing. This will happen also if the STDIN filehandle
is a pipe.
To use this option IO::Scalar needs to be installed.
|<B>-vB>, <B>--versionB>||Print the version of the program and exit.|
XDG_DATA_HOME XDG_DATA_DIRS These variables can list base directories to search for data files. The shared mime-info will be expected in the mime sub directory of one of these directories. If these are not set, there will be searched for the following directories:
$HOME/.local/share/mime /usr/local/share/mime /usr/share/mime
See also the XDG Base Directory Specification <http://freedesktop.org/Standards/basedir-spec>
The base dir for all data files is determined by two environment variables, see ENVIRONMENT.
BASE/mime/packages/SOURCE.xml All other files are compiled from these source files. To re-compile them use <B>B>update-mime-database<B>(1)B>. BASE/mime/globs Compiled information about globs. BASE/mime/magic Compiled information about magic numbers. BASE/mime/MEDIA/SUBTYPE.xml Descriptions of a mimetype in multiple languages, used for the --describe switch.
If a file has an empty mimetype or an empty description, most probably the file doesnt exist and the given name doesnt match any globs. An empty description can also mean that there is no description available in the language you specified.
The program exits with a non-zero exit value if either the commandline arguments failed, a module it depends on wasnt found or the shared mime-info database wasnt accessible. See File::MimeInfo for more details.
The --all switch doesnt really show all matches, but only one per mime-typing method. This needs to be implemented in the modules first.
If you find bugs, please file them in our Github issue tracker at <https://github.com/mbeijen/File-MimeInfo/issues>.
<B>mimetypeB> doesnt provide a switch for looking inside compressed files because it seems to me that this can only be done by un-compressing the file, something that defeats the purpose. On the other hand the option should exist for strict compatibility with file(1). Possibly a subclass should be made for this one day.
Jaap Karssenberg <email@example.com> Maintained by Michiel Beijen <firstname.lastname@example.org>
Copyright (c) 2003, 2012 Jaap G Karssenberg. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
file(1), update-mime-database(1), File::MimeInfo(3), <http://freedesktop.org/Software/shared-mime-info>
|perl v5.20.3||MIMETYPE (1)||2015-02-23|