搜索
  • 登录
  • 注册
密码重置成功

关注您感兴趣的项目并了解有关它们的最新消息

编程词典

服务码农的在线技术手册
热门搜索:
词典首页 服务端 Linux Linux file命令
Linux file命令 用法详解

Linux file命令

中文翻译 最近更新: 2018-06-13 09:25:11

file

英 [faɪl]   美 [faɪl]  

vt.提出(离婚诉讼或其他讼案);把…归档;用锉锉;发稿,寄给报社

vi.发送(报道给报社);排成一行行走;提出申请

n.档案;文件(夹);纵列;锉刀

第三人称单数: files 复数: files 现在分词: filing 过去式: filed 过去分词: filed

Linux file命令 语法

作用:file命令用于辨识文件类型。通过file指令,我们得以辨识该文件的类型。

语法:file [-bcLvz][-f <名称文件>][-m <魔法数字文件>...][文件或目录...]

Linux file命令 示例

显示文件类型:

[root@localhost ~]# file install.log
install.log: UTF-8 Unicode text[root@localhost ~]# file -b install.log      <== 不显示文件名称UTF-8 Unicode text[root@localhost ~]# file -i install.log      <== 显示MIME类别。install.log: text/plain; charset=utf-8[root@localhost ~]# file -b -i install.log
text/plain; charset=utf-8

显示符号链接的文件类型

[root@localhost ~]# ls -l /var/mail
lrwxrwxrwx 1 root root 10 08-13 00:11 /var/mail -> spool/mail[root@localhost ~]# file /var/mail/var/mail: symbolic link to `spool/mail'
[root@localhost ~]# file -L /var/mail
/var/mail: directory
[root@localhost ~]# file /var/spool/mail
/var/spool/mail: directory
[root@localhost ~]# file -L /var/spool/mail
/var/spool/mail: directory
Linux file命令