I run stuff like this in a bash script:
set -x
time convert 'cat.png' -quality 100 test.webp
time convert 'cat.png' -quality 100 test.jpeg
du -h test.webp test.jpeg
It would often print output like this:
+ du -h test.webp test.jpeg
512 test.webp
387K test.jpeg
512
bytes for the webp file seems impossibly small, right?
When I run the du -h
afterwards in the terminal, it shows a different size (which is more reasonable).
I know that du
without --apparent-size
shows the underlying storage size (e.g. number of blocks multiplied by some factor), but I would still expect that to always print the same, deterministic result.
What is going on?
stat
command if you want to get those numbers without usingstrace
:stat -c '%B %4b %n' test.webp
would have given131072 1029 test.webp
for the second measurement. – Neil Mayhew May 26 '20 at 13:49