How to get file size in bytes from shell script?
One easy approach is:
stat -f%z image.png
stat
normally spits out a bunch of data, but the %z
format just selects the size in bytes.
On OSX do stat -f "%z bytes"
.
One easy approach is:
stat -f%z image.png
stat
normally spits out a bunch of data, but the %z
format just selects the size in bytes.
On OSX do stat -f "%z bytes"
.