国语自产精品视频在线看:您身边最放心的安全下载站! 最新软件|热门排行|软件分类|软件专题|厂商大全

国语自产精品视频在线看

技术教程
您的位置:首页操作系统linux → Linux查看所有子文件夹及文件的数量

Linux查看所有子文件夹及文件的数量

我要评论 2012/09/26 11:31:56 来源:国语自产精品视频在线看 编辑:zbbingyang.com [ ] 评论:0 点击:249次

find命令查看(推荐):

所有子目录的数量:

[root@localhost ~]# find xkermulu -type d | wc -l
125
[root@localhost ~]# find xkermulu/ -type d | wc -l
125
[root@localhost ~]# find xkermulu/* -type d | wc -l


124 --正确🥃
结果不【jié guǒ bú】同的原🔇因:
[root@localhost ~]# find xkermulu -type d | more
xkermulu --输出结🎊果首行【guǒ shǒu háng】
[root@localhost ~]# find xkermulu/* -type d | more
xkermulu/examples --输出结🎊果首行【guǒ shǒu háng】

总结🏹:使用xkermulu/*不包含xkermulu这个父🌤目录,只输出【zhī shū chū】其下的【qí xià de】🌌子目录【zǐ mù lù】。

所有文件的数量:

[root@localhost ~]# find xkermulu -type f | wc -l
987
[root@localhost ~]# find xkermulu/ -type f | wc -l
987
[root@localhost ~]# find xkermulu/* -type f | wc -l
987

tree命令查看(不推荐):

[root@localhost ~]# tree xkermulu
……
124 directories, 984 files
-----------------------------------------
[root@localhost ~]# tree xkermulu/
……
124 directories, 984 files

du命令查看:

[root@localhost ~]# du -ah xkermulu/* | wc -l
1111

总结💫:du查看的【chá kàn de】结🔹果为【guǒ wéi】1111,子目录🍑的数量【de shù liàng】为124,文件数【wén jiàn shù】量为:1111-124=987,所以tree命令查【mìng lìng chá】看的结🔹果应该🎡是不准确,至于少🔋计算了🙀哪个文件,没再查【méi zài chá】🥜这个问题【tí】,推荐使用【yòng】find命令查【mìng lìng chá】看。

关键词:Linux

阅读本文后您有什么感想? 已有 人给出评价!

  • 0 欢迎喜欢
  • 0 白痴
  • 0 拜托
  • 0 哇
  • 0 加油
  • 0 鄙视