file命令
2.命令格式:
file [-beLvz][-f <名称文件>][-m <魔法数字文件>...][文件或目录...]
3.命令功能:
通过file指令,我们得以辨识该文件的类型
4.命令参数:
-b 列出辨识结果时,不显示文件名称。-c 详细显示指令执行过程,便于排错或分析程序执行的情形。
-f<名称文件> 指定名称文件,其内容有一个或多个文件名称呢感,让file依序辨识这些文件,格式为每列一个文件名称。
-L 直接显示符号连接所指向的文件的类别。
-m<魔法数字文件> 指定魔法数字文件。
-v 显示版本信息。
-z 尝试去解读压缩文件的内容。
-F, --separator string usestring as separator instead of `:'
-i, --mime output mime typestring
-k, --keep-going don't stopat the first match
-n, --no-buffer do not buffer output
-N, --no-pad do not padoutput
-p, --preserve-date preserveaccess times on files
-r, --raw don'ttranslate unprintable chars to \ooo
-s, --special-files treat special (block/char devices) files as ordinaryones
--version 显示版本信息。
5.使用实例:
5.1file -i file1------------------------------------------各种选项效果