Search This Blog

Total Pageviews

Saturday, 10 March 2018

Linux - Sum using awk



UNIX  Sum using awk


unix sum for file 

ls -ltr|grep -i 'Mar 10' | awk '{ SUM += $5} END { print SUM/1024/1024/1024 }'        --- in GB

ls -l  database_full_*_2859*_1.bk  | awk '{ SUM += $5} END { print SUM/1024/1024 }'   --- In Mb           

 find /u01/app/oracle/diag/rdbms/anuj/ANUJ/trace -name '*.trm' -exec ls -l {} \; | awk '{ Total += $5} END { print Total/1024/1024 }'


No comments:

Oracle DBA

anuj blog Archive