查看目录大小以及目录数量的命令

[root@localhost /]# cd /etc
查看 当前目录大小
[root@localhost etc]# du -sh
92M     .
[root@localhost etc]# du . -sh /etc
92M     .
92M     /etc
查看当前目录的文件数量
[root@localhost etc]# find . -type f |wc -l
1256
查看指定目录的文件的数量
[root@localhost etc]# find /etc -type f |wc -l
1256
查看当前目录里子目录的数量
[root@localhost etc]# find . -type d |wc -l
204
[root@localhost etc]# find /etc -type d |wc -l
204
[root@localhost etc]# 
原文地址:https://www.cnblogs.com/liang545621/p/7528489.html