We have two zip files and would like to compare them.
We're also interested in calculating the percentage difference between them and the file size. Is there a tool that can do this quickly?
You could try a bash script like this one:
You then call the script by passing the two files as arguments. I used the command
Notice that we need to call the program
Of course you can modify the script to fulfill your needs. If you need to compare two compressed files with the uncompressed file you can add another variable and do the desired maths using
You could simply write a Perl script to handle the job. It's less messy than Bash.
Here's an example of such a script. It calculates the file size reduction between the original and compressed file.
You execute it like this:
NOTE: You can quote out or remove the