count腳本
#!/bin/shnumOfArgs=$#if [ $numOfArgs -ne 1 ]; then echo -e "Usage: /nbash $0 dirForCount" exit -1fi# argsROOTDIR=$1# core partfind $ROOTDIR -maxdepth 1 -type d | sort | while read dir; docount=$(find "$dir" -type f | wc -l)echo "$dir: $count"done
執行
$ bash count.sh benchmark
benchmark: 2317
benchmark/0: 20
benchmark/1: 891
benchmark/2: 65
benchmark/3: 13
benchmark/4: 1328
總結
以上就是這篇文章的全部內容了,希望本文的內容對大家的學習或者工作具有一定的參考學習價值,謝謝大家對VEVB武林網的支持。
新聞熱點
疑難解答