I have a list of directories I want to compress on an ubuntu machine.
Is there any tool to automatically calculate the size of the of my folders and copy the size to the name of the compressed file?
I have some thing like that:
$du -h -d 1 671G ./folder1 2.7T ./folder2 I would like it to be like this
$ls -1 folder1.671.G.tar.gz folder2.2.7T.tar.gz The given sizes with the du -h -d 1 are the non-compressed one, so the size calculation needs to happen after the compression.
Thanks
du -hat any time. The uncompressed size (which would result from unpacking the archive) is IMHO a much more useful information.