find / -type f -name "*.log*" -exec du -b {} \; | awk '{ sum += $1 } END { kb = sum / 1024; mb = kb / 1024; gb = mb / 1024; printf "%.0f MB (%.2fGB) disk space used\n", mb, gb}'Just replace "*.log*" with the file extension you want to search for and the above will give you the disk used by the sum of all the files with that extension.
No comments:
Post a Comment