如何在魔术文件中搜索扩展名 [英] How to search for extension in magic files

查看:78
本文介绍了如何在魔术文件中搜索扩展名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道您可以使用

file *.myext 

但是我想知道是否可以在我的魔术文件中写入一行,例如在所有".42" ex上返回成功消息:myfile.42

But I'm wondering if I can write into my magic file a line which for example return a success message on all the ".42" ex : myfile.42

想象一个包含以下文件的文件夹

imagine a folder with the following files

  • test1.42
  • test2.kk
  • test3.42

我的魔术文件的内容应该是什么,以便仅在test1.42和test2.42上获得成功

what should be the content of my magic file in order to make a success only on test1.42 and test2.42

我暂时尝试过

>0xA2 string 42 success

推荐答案

linux/unix并不关心文件扩展名,魔术数字表示文件的第一个字节,用于确定文件的类型.

linux/unix doesn't care about filename extensions, magic numbers represents first bytes of file which are used to determine type of file.

这篇关于如何在魔术文件中搜索扩展名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆