top of page
Search

Sum file size in Unix

  • Writer: abhskuma
    abhskuma
  • Apr 14
  • 1 min read

To sum size of all files of a certain name type :-

For example, we want to know the sum of all files having a common name "access.log"

ls -lrt access.log* | awk '{ sum += $5 } END{ printf "%0.2f\n", sum/(1024*1024*1024) }'

The above command gives the output in GB


 
 
 

Comments


Learn and share

© 2035 by Learn and share. Powered and secured by Wix 

bottom of page