
我有兩個文件:
$cat myMagic 20 string TEST ThisIsTestType
$cat testFile TEST i am test file from inside
兩個檔案都在同一目錄中。
$file testFile testFile: ASCII text
為什麼我得到了ASCII text
卻沒有得到testFile: ThisIsTestType
?
提前謝謝了!
答案1
file
預設使用其預先編譯的魔法資料庫 - 您需要使用該選項告訴它使用您的自訂檔案-m
。
前任。
$ file testFile
testFile: ASCII text
但
$ file -m myMagic testFile
testFile: ThisIsTestType
$