文件数量
-
Linux如何统计某个目录下文件数量



使用find命令统计当前目录下文件数量:find /path/to/dir -maxdepth 1 -type f | wc -l,仅统计普通文件;2. 通过ls和grep过滤:ls -l /path/to/dir | grep “^-” | wc -l,但可能因特殊字符不准…



使用find命令统计当前目录下文件数量:find /path/to/dir -maxdepth 1 -type f | wc -l,仅统计普通文件;2. 通过ls和grep过滤:ls -l /path/to/dir | grep “^-” | wc -l,但可能因特殊字符不准…