linux shell 统计当前文件夹指定类型文件数量脚本

以统计当前目录下 .exe,.zip,.7z 后缀文件数量为例:

#!/bin/sh
find -type f \( -name "*.exe" -o -name "*.zip" -o -name "*.7z" \) | wc -l

将此脚本保存成 count.sh 并放入要统计的目录下,运行 sh count.sh

posted @ 2024-04-24 22:35  天才俱乐部  阅读(74)  评论(0)    收藏  举报