[root@localhost bin]# file --help
Usage: file [OPTION...] [FILE...]
Determine type of FILEs.
--help display this help and exit
-v, --version output version information and exit
-m, --magic-file LIST use LIST as a colon-separated list of magic
number files
-z, --uncompress try to look inside compressed files
-b, --brief do not prepend filenames to output lines
-c, --checking-printout print the parsed form of the magic file, use in
conjunction with -m to debug a new magic file
before installing it
-e, --exclude TEST exclude TEST from the list of test to be
performed for file. Valid tests are:
ascii, apptype, compress, elf, soft, tar, tokens, troff
-f, --files-from FILE read the filenames to be examined from FILE
-F, --separator STRING use string as separator instead of `:'
-i, --mime output MIME type strings (--mime-type and
--mime-encoding)
--apple output the Apple CREATOR/TYPE
--mime-type output the MIME type
--mime-encoding output the MIME encoding
-k, --keep-going don't stop at the first match
-l, --list list magic strength
-L, --dereference follow symlinks (default)
-h, --no-dereference don't follow symlinks
-n, --no-buffer do not buffer output
-N, --no-pad do not pad output
-0, --print0 terminate filenames with ASCII NUL
-p, --preserve-date preserve access times on files
-r, --raw don't translate unprintable chars to \ooo
-s, --special-files treat special (block/char devices) files as
ordinary ones
-C, --compile compile file specified by -m
-d, --debug print debugging messages
--文件夹
[root@localhost software]# file nginx-1.9.3
nginx-1.9.3: directory
--压缩包
[root@localhost software]# file jdk-7u79-linux-x64.gz
jdk-7u79-linux-x64.gz: gzip compressed data, from Unix, last modified: Fri Apr 10 11:53:41 2015
--DOS的bat文件
[root@localhost bin]# file startup.bat
startup.bat: DOS batch file, ASCII text, with CRLF line terminators
--Sheel脚本
[root@localhost bin]# file startup.sh
startup.sh: POSIX shell script, ASCII text executable
相关推荐
有些软件通过改变文件的扩展名隐藏文件的真实类型。例如,有些游戏的音乐和动画其实是标准的MID和AVI文件...现在编写一个程序,使它从一个配置文件中获得字符串与文件类型的对应表,然后判断用户指定的文件的真实类型!
欢迎使用FileAnalysis(原名:文件类型分析器) 本软件不仅可用于查看文件的类型、真实扩展名、编码、MD5码等,更重要的是它还可用于查看生成此文件的开发工具、加壳工具。本软件采用内部特征码的原理,分析时与...
filetype.py Small and dependency free Python package to ...一个小巧自由开放Python开发包,主要用来获得文件类型。包要求Python 3.+ 功能特色 •简单友好的API •支持宽范围文件类型 •提供文件扩展名和MIME类型
java文件的工具类,封装了常用的操作,尤其针对文件的实际类型,通过获取文件的byte,来查看文件起始字节的魔数值,通过魔数值来判断文件的类型,工具集合了常用的文件类型对应的魔数,也封装了文件类型的判断方法
作为一个客户或玩家,对比MD5码能判断文件是否被非法修改过;作为一个普通用户,了解未知的文件类型以及真实扩展名能间接的防止病毒的入侵和认识文件的用途。而且本软件绿色、无需安装,并支持关联/取消关联系统右键...
现有一文件,其扩展名未知或标记错误。假设它是一个正常的、非空的文件,...压缩包里的JSON文件包含了我新增的一些特殊文件类型,打开方式在cmd窗口输入“py-checkfiletype-master”回车,拖入待测文件/文件夹即可识别
用户更改后缀名后在用扩展名判断文件类型,是不准确的。所以改为用读取文件二进制方式,读取文件头来跟MP4信息头对比判断。
前面讲过Android系统内部的MediaFile类来获取文件类型的办法,这个类主要是根据文件的扩展名来判断,其准确性不是很好。具体可查看Android系统使用MediaFile类判断音频文件类型。其实,获取文件类型最好的办法便是...
本文实例讲述了php实现不通过扩展名准确判断文件类型的方法。分享给大家供大家参考,具体如下: 第一种方法 通过php的finfo_file() $handle=finfo_open(FILEINFO_MIME_TYPE);//This function opens a magic...
作为一个客户或玩家,对比MD5码能判断文件是否被非法修改过;作为一个普通用户,了解未知的文件类型以及真实扩展名能间接的防止病毒的入侵和认识文件的用途。而且本软件绿色、无需安装,并支持关联/取消关联系统右键...
python脚本,遍历指定目录,通过二进制方式读取文件,根据文件头信息识别文件类型,将判断结果输出。 示例如下: The file 'a125e0e3947********0a69191a349ca' is of type: EXE The file 'e08fe2de3dd********47d...
文件类型 检测Buffer / Uint8Array / ArrayBuffer的文件类型 通过检查缓冲区的来检测文件类型。 该软件包用于检测基于二进制的文件格式,而不是诸如.txt , .csv , .svg等基于文本的格式。 安装 $ npm install ...
控件UpdloadFile文件上传eg: string newfilename = file_uploadid.FileName; string size = file_uploadid.PostedFile.ContentLength.ToString(); string type = file_uploadid.PostedFile.ContentType; string ...
它的类库很小,只有500K左右,利用该类库判定文本文件的代码如下(由于cpdetector的算法使用概率统计,所以结果并不是100%准确的,但是是迄今为止我见过
//判断是否是图片 function isImg(){ var f=$("#imgFile").val(); if(f==""){ alert("请上传图片");return false; }else { if(!/\.(gif|jpg|jpeg|png|GIF|JPG|PNG)$/.test(f)) { alert("图片类型必须是.gif,...
1、获取文件后缀 有时候我们需要通过文件名或者路径,得到该文件的后缀名(扩展名),...我们得到文件后缀名后,根据后缀即可判断文件的类型(文件格式)。比如我们需要判断一个文件是否是图片格式,首先定义一个判断
本文实例展示了JavaScript判断文件上传类型的方法,是一个非常常用的技巧。具体实现方法如下: 文件上传时用到一个功能,使用html元素的input标签实现: <input id="imageFile" name="imageFile1" accept="image...
把系统扫描产生的CHK文件恢复成原来的文件类型的工具. 文件类型,支持.mp3,.jpg,.bmp,.avi,.mpg,.doc,.gif. 也可以增加需要的文件类型: 增加支持文件类型的方法: 方法:打开file.type文件(文件本件),按照如下格式要求,...
主要介绍了用ASP.net判断上传文件类型的三种方法,需要的朋友可以参考下
注意:input[type=file] 标签中的属性accept=application/msword,application/pdf 在pc上正常,但是在手机ios和android上这个文件格式限制会被忽略,所以需要在js中增加格式的判断,以及对应显示样式的设置.(我也是刚...