1、如何查看根目录下每个目录下的文件个数
find ./ -maxdepth 1 -type d | while read dir; do count=$(find "$dir" -type f | wc -l) echo "$dir : $count" done也可采用如下命令for i in ./*; do echo $i; find $i | wc -l; done
2、如何查看当前目录下文件的大小
du -lh --max-depth=1