linux基础命令file

file

目的:识别文件类型
格式:
file 文件名

自我们接受linux的第一天起,就一直在被强调,linux下一切接文件。
举例:
file ~/.bashrc 为ASCII编码的test类型

book@www.100ask.org:~/linux/dira$ file ~/.bashrc
/home/book/.bashrc: ASCII text

file ~/.vimrc 为UTF-8 Unicode 编码的test类型
file ~/Pictures/* 如图形文件JPEG/PNG/BMP格式

book@www.100ask.org:~/linux/dira$ file ~/Pictures/*
/home/book/Pictures/235113-1403260U22059.jpg: JPEG image data, JFIF standard 1.02, resolutio                                               n (DPI), density 72x72, segment length 16, baseline, precision 8, 1000x563, frames 3
/home/book/Pictures/534ce34bc9b13.png:        PNG image data, 1024 x 518, 8-bit/color RGB, n                                               on-interlaced
/home/book/Pictures/lehf1234.bmp:             PC bitmap, Windows 3.x format, 720 x 540 x 24
/home/book/Pictures/smplayer_screenshots:     directory

file ~/100ask/ 为directory表明这是一个目录
file ~/bin/pwd 出现ELF 64-bit LSB executable,即为ELF格式的可执行文件

book@www.100ask.org:~/linux/dira$ file /bin/pwd
/bin/pwd: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpret                                               er /lib64/l, for GNU/Linux 2.6.32, BuildID[sha1]=aa7c30c99b95a56eb73eae57076d485a2d05a9c3, s                                               tripped

file /dev/* 出现character special(字符设备文件)

book@www.100ask.org:~/linux/dira$ file /dev/*
/dev/agpgart:            character special (10/175)
/dev/block:              directory
/dev/cdrom:              symbolic link to sr0
/dev/loop0:              block special (7/0)


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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值