linux常用命令

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
posted @ 2020-04-21 13:24  迷你淘  阅读(149)  评论(0)    收藏  举报