Da página man magic (5):
Some file formats contain additional information which is to be printed along with the file type or need additional tests to determine the true file type. These additional tests are introduced by one or more > characters preceding the offset. The number of > on the line indicates the level of the test; a line with no > at the beginning is considered to be at level 0. Tests are arranged in a tree-like hierarchy: If a the test on a line at level n succeeds, all following tests at level n+1 are performed, and the messages printed if the tests succeed, untile a line with level n (or less) appears. For more complex files, one can use empty messages to get just the "if/then" effect, in the following way:
0 string MZ
>0x18 leshort <0x40 MS-DOS executable
>0x18 leshort >0x3f extended PC executable (e.g., MS Windows)
Em nosso sistema Scientific Linux 5.5, /usr/share/file/magic.mime
lines 836..838 se parece com isto:
0 string 07101121 application/msword
>546 string bjbj application/msword
>546 string jbjb application/msword
Portanto, assim que a primeira linha corresponder, file
verificará bjbj
e jbjb
no local especificado, imprimindo uma sequência application/msword
adicional em caso de sucesso.
Nota: se você quiser corrigir esse arquivo, terá que remover, renomear ou gerar novamente (com file -C
) a versão binária, /usr/share/file/magic.mime.mgc
, pois file
prefere a versão em texto.