The location of the file
database appears to installation/version-dependent.
The linuxmanpages.com version of file(1)
says:
FILES
/usr/share/file/magic.mgc
Default compiled list of magic numbers
/usr/share/file/magic
Default list of magic numbers
/usr/share/file/magic.mime.mgc
Default compiled list of magic numbers, used to output mime types when the -i
option is specified.
/usr/share/file/magic.mime
Default list of magic numbers, used to output mime types when the -i
option is specified.
/etc/magic
Local additions to magic wisdom.
whereas, on Cygwin and Debian, file(1)
says
FILES
/usr/share/misc/magic.mgc
Default compiled list of magic.
/usr/share/misc/magic
Directory containing default magic files.
To further confuse matters, on Debian, /usr/share/misc/magic
is a symbolic link to /usr/share/file/magic
, which is an empty directory,
while, on Cygwin, /usr/share/file/magic
is a symbolic link to /usr/share/misc/magic
,
which is a fairly large file (> 600K).
So I did the obvious experiment:
file /usr/share/misc/magic
/usr/share/misc/magic: Non-ISO extended-ASCII text, with overstriking
I looked at it with vi
, and it looked like ASCII text
(but I didn’t scrutinize all 17000 lines).
“with overstriking” seems to indicate the presence of backspaces; see
echo -e "1 =\b/ 2" | file -
/dev/stdin: ASCII text, with overstriking
so I searched /usr/share/misc/magic
for backspaces, and I found two.
/usr/share/misc/magic
not to/usr/share/mime/magic
.