Get total size of group of files

Useful script when trying to get the size of a group of files in a folder, such as backup files.
en español

# sum the file sizes for all the files named rman_20131231_ORADB; show as MB
ls -ltr | grep rman_20131231_ORADB | awk ‘{ total += $5 }; END { print total/1024/1024} ‘

NOTE: tested in AIX and Linux 6 only.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s