Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

totalling columns/fields

Status
Not open for further replies.

kyle123

Technical User
Feb 27, 2003
5
US
Howdo you total the file size field from tar tvf output to verify the backup size is the same as the restored size?
Thanks.
 
Something like this should work:
Code:
tar tvf foo.tar | awk '{sum+=$3}END{print sum}'
This is assuming your version of tar prints the size value in the 3rd column of your output...
Hope this helps :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top