如何递归获取目录下所有文件的总大小
How to get total size of all files recursively under directory
我正在使用此命令获取小于 17MB 的文件:
hadoop fsck /admin_test -files |
gawk '{if ( ~ /^[0-9]+$/ && <= 17825792) print ,;}'
如何得到小于 17MB 的所有文件的总大小?
gawk '
~ /^[0-9]+$/ && <= 17825792 {sum += ; print , }
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
我正在使用此命令获取小于 17MB 的文件:
hadoop fsck /admin_test -files |
gawk '{if ( ~ /^[0-9]+$/ && <= 17825792) print ,;}'
如何得到小于 17MB 的所有文件的总大小?
gawk '
~ /^[0-9]+$/ && <= 17825792 {sum += ; print , }
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