Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
awksum [2018/01/08 12:09]
yassine chaouche
awksum [2018/01/08 12:12] (current)
yassine chaouche
Line 4: Line 4:
  
 ''​awk '​{sum+=$3} END {print sum}'''​ will sum on the third column and print the sum at the END. ''​awk '​{sum+=$3} END {print sum}'''​ will sum on the third column and print the sum at the END.
 +
 +Example with ''​find''​ : 
 +
 +<​code>​
 +$ find /​var/​vmail/​mydomain.tld/​m.stefan -mtime -7 -type f -not -name '​*dovecot*'​ -printf %s\n | awk '​{sum+=$1} END {print (sum / 1024)}'​
 +234399
 +$
 +</​code>​
 +
 +This prints the size of the mail (in Kilobytes) received by user m.stefan in the last 7 days, which is 234M in this example.
  
 ---- ----
 contact : [[http://​twitter.com/​ychaouche|@ychaouche]] yacinechaouche at yahoocom contact : [[http://​twitter.com/​ychaouche|@ychaouche]] yacinechaouche at yahoocom

QR Code
QR Code awksum (generated for current page)