Reading the documentation about the Linux file command. I have found this in the magic test description:
Any file with some invariant identifier at a small fixed offset into the file can usually be described in this way. The information identifying these files is read from /etc/magic and the compiled magic file /usr/share/misc/magic.mgc, or the files in the directory /usr/share/misc/magic if the compiled file does not exist. In addition, if $HOME/.magic.mgc or $HOME/.magic exists, it will be used in preference to the system magic files.
I can imagine that the magic file is a collection of "MagicNumber -> Kind of file" relation. That the "file" program runs to find the kind of file, taking the header of the file. But I no understand why:
- Why this file should be compiled?
- What is the way than you can create a magic compile file to use with the command?
- What is the usage of command options related to this kind of test and file? Ex:
-C or -m.