I am a fond user of the ncdu utility to figure out how space is used within a directory.
However, I have a use case where I am trying to choose which folders to backup and which folders not to backup, and the backups will be compressed (as a .tar.xz archive, but I suppose .tar.gz would yield the same result for what I have in mind). So, intuitively, I do not care that much about files that are large but will compress well (e.g., email archives), whereas I care more about files that are relatively small but will not compress at all (e.g., JPG pictures). I want to see files and folders sorted by their compressed size, not their actual uncompressed size.
A natural solution would be to compress all files, and then have an ncdu
-like tool that would operate on the archive to tell me how folders take up space in the archive.
Is there any such utility?
I am OK with GUI programs (although I would prefer text-based ones), and I am OK with methods that would only work for a different compression algorithm as I imagine they would still yield useful results (e.g., replicate the hierarchy in a filesystem with built-in compression/deduplication).