簡體   English   中英

如何遞歸獲取目錄下所有文件的總大小

[英]How to get total size of all files recursively under directory

我正在使用此命令來獲取小於17MB的文件:

hadoop fsck /admin_test -files | 
gawk '{if ($2 ~ /^[0-9]+$/ && $2 <= 17825792) print $1,$2;}'

如何獲得小於17MB的所有文件的總大小?

gawk '
    $2 ~ /^[0-9]+$/ && $2 <= 17825792 {sum += $2; print $1, $2} 
    END {print "sum=", 0+sum}
'

如何將du--threshold=SIZE參數一起使用:

       -t, --threshold=SIZE
          exclude entries smaller than SIZE if positive, or entries greater than SIZE if negative

像這樣的東西:

du -sk --threshold=-17825792 /admin_test

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM