查看某目录占用空间:
du -sh directory
查看某目录下有多少个文件:
find directory -type f | wc -l
find 命令示例
find 查找当前目录下有多少个c文件
find ./ -type f -name "*.c" | wc -l
find 命令简单解释
参数 -type 代表文件的类型,文件类型对应如下关系
b 块文件 (如内存)
c 字符文件 (如串口)
d 目录文件 (目录也是文件的一种)
p 有名管道 (FIFO)
f 普通文件
l 符合链接
参数 -name 指定文件名,可以使用shell里边的通配符