2016-01-14 249 views

回答

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

吹毛求疵:'END ...總和+ 0'如果沒有的這些文件符合條件。 –

+1

不錯。爲什麼我以前沒見過那個成語? –

+0

idk,我認爲這是常見的。 –

1

怎麼樣使用du--threshold=SIZE ARG:

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

是這樣的:

du -sk --threshold=-17825792 /admin_test 
+0

它給出了錯誤。在hadoop中,它不能像那樣使用 – Naveen

相關問題