首页 > 系统服务 > 详细

Linux 命令 - file: 确定文件类型

时间:2015-09-30 16:11:25      阅读:203      评论:0      收藏:0      [点我收藏+]

命令格式

file [-bchikLNnprsvz0] [--apple] [--mime-encoding] [--mime-type] [-e testname] [-F separator] [-f namefile] [-m magicfiles] file ...

file -C [-m magicfiles]

file [--help]

 

命令参数

-b, --brief
  不输出文件名(简要模式)。

-L, --dereference
  直接显示符号连接所指向的文件的类型。

-v, --version
  打印版本信息。

-z, --uncompress
  试图查看压缩文件内部信息。

--help
  打印帮助信息。

 

实例

a) 查看文件 hello.sh、hello.ln 和 hello.zip 的类型。

[huey@huey-K42JE ~]$ file hello.sh hello.ln hello.zip 
hello.sh:  Bourne-Again shell script text executable
hello.ln:  symbolic link to `hello.sh‘
hello.zip: Zip archive data, at least v1.0 to extract

b) 直接显示 hello.ln 所指向的文件的类型。

[huey@huey-K42JE ~]$ file -L hello.sh
hello.sh: Bourne-Again shell script text executable

c) 试图查看压缩文件 hello.zip 的内部信息。

[huey@huey-K42JE ~]$ file -z hello.zip 
hello.zip: Bourne-Again shell script text executable (Zip archive data, at least v1.0 to extract)

 

Linux 命令 - file: 确定文件类型

原文:http://www.cnblogs.com/huey/p/4849087.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!