免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12
最近访问板块 发新帖
楼主: xubigtree
打印 上一主题 下一主题

[学习分享] linux文件类型和file命令的疑惑 [复制链接]

论坛徽章:
21
白羊座
日期:2013-08-23 15:49:17金牛座
日期:2013-10-08 17:00:03处女座
日期:2013-10-12 11:54:11CU十二周年纪念徽章
日期:2013-10-24 15:41:34午马
日期:2013-11-27 14:07:21巨蟹座
日期:2013-12-04 10:56:03水瓶座
日期:2013-12-04 15:58:00亥猪
日期:2014-05-24 16:02:3115-16赛季CBA联赛之辽宁
日期:2016-11-07 13:52:53戌狗
日期:2013-08-23 16:15:31白羊座
日期:2013-08-24 21:59:24巨蟹座
日期:2013-08-25 16:34:24
11 [报告]
发表于 2012-07-25 09:39 |只看该作者
回复 10# xubigtree


    根据file 也可以反映出文件的类弄,
如:
  1. $ file /opt/
  2. /opt/: directory

  3. $ file /dev/zero
  4. /dev/zero: character special (1/5)
复制代码

论坛徽章:
0
12 [报告]
发表于 2012-07-25 09:42 |只看该作者
我猜想你所选择的文件用file命令查看时候,如果用ll显示第一个显示的都是-,即普通文件
而:
-  普通文件,或更准确地说,不属于以上几种类型的文件。

建议看下这个   http://hi.baidu.com/kingfly66666 ... 03dcec82025cff.html

论坛徽章:
0
13 [报告]
发表于 2012-07-25 10:27 |只看该作者
谢谢楼上所有人的回答。谢了

论坛徽章:
0
14 [报告]
发表于 2012-07-25 10:45 |只看该作者
参考::The type printed will usually contain one of the words
text (the file contains only printing characters and a few common control characters and is probably safe to read on an ASCII terminal),

executable (the file contains the result of compiling a program in a form understandable to some UNIX kernel or another),

data meaning anything else (data is usually `binary' or non-printable).

Any file that cannot be identified as having been written in any of the character sets listed above is simply said to be ``data''.  

http://linux.about.com/library/cmd/blcmdl1_file.htm

论坛徽章:
13
15-16赛季CBA联赛之同曦
日期:2016-01-28 19:52:032015亚冠之北京国安
日期:2015-10-07 14:28:19NBA常规赛纪念章
日期:2015-05-04 22:32:03处女座
日期:2015-01-15 19:45:44卯兔
日期:2014-10-28 16:17:14白羊座
日期:2014-05-24 15:10:46寅虎
日期:2014-05-10 09:50:35白羊座
日期:2014-03-12 20:52:17午马
日期:2014-03-01 08:37:27射手座
日期:2014-02-19 19:26:54子鼠
日期:2013-11-30 09:03:56狮子座
日期:2013-09-08 08:37:52
15 [报告]
发表于 2012-07-25 10:51 |只看该作者
kellyseeme123 发表于 2012-07-25 10:45
参考::The type printed will usually contain one of the words
text (the file contains only printi ...


很详细,欢迎分享 ^_^
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP