8.每日一个Linux命令----file

描述:查看某个文件的基本信息

用法:file [option] 文件名

常用参数:

-f:查看文件中的文件名的文件类型

-z:尝试去解读压缩文件的内容

-L:查看软连接对应的文件类型

示例:1.使用file命令查看/bin/ls的文件信息

[root@share19 ~]# file /bin/ls
/bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=0xec333a104e045327c5e3d0ca6dda16c610a210f3, stripped

2.尝试去解读压缩文件的内容

[root@DB-Server ~]# file -z Temp.txt.gz 
Temp.txt.gz: UTF-8 Unicode text, with very long lines, with CRLF line terminators (gzip compressed data, was "Temp.txt", from Unix, last modified: Tue Jun 24 00:34:15 2014)

3.查看软连接对应的文件类型

[root@DB-Server ~]# ln -s Temp.txt.gz sfile
[root@DB-Server ~]# file sfile 
sfile: symbolic link to `Temp.txt.gz'
[root@DB-Server ~]# file -L sfile 
sfile: gzip compressed data, was "Temp.txt", from Unix, last modified: Tue Jun 24 00:34:15 2014

 

转载于:https://my.oschina.net/u/2711763/blog/680900

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值