日期:2012/09/26 11:31:56来源: 绿色资源网整理
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 --正确
结果不同的原因:
[root@localhost ~]# find xkermulu -type d | more
xkermulu --输出结果首行
[root@localhost ~]# find xkermulu/* -type d | more
xkermulu/examples --输出结果首行
总结:使用xkermulu/*不包含xkermulu这个父目录,只输出其下的子目录。
所有文件的数量:
[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查看的结果为1111,子目录的数量为124,文件数量为:1111-124=987,所以tree命令查看的结果应该是不准确,至于少计算了哪个文件,没再查这个问题,推荐使用find命令查看。
相关文章
相关下载
limbo镜像linux文件 系统其它556.15Mv1.0
详情SwingInspector for Linux 编程工具6.72Mv1.0
详情智能陈桥五笔 for Linux 汉字输入1.82Mv1.0
详情rdesktop(Linux远程桌面管理) 远程监控378KBv1.0
详情stupid-ftpd(嵌入式linux平台ftp服务端软件) FTP 工具34KBv1.0
详情制作linux启动u盘(rufus) U盘工具599KBv1.0
详情网友评论