title: How to get file size in bytes from shell script?
body: <p>I am trying to create a script to write an XML file for Apple's ITMSP Transporter files for uploading metadata to the App Store. Requirements for screenshots are filename, MD5 checksum and filesize in bytes.</p>
  
  <p>MD5 checksum is easy and be can be retrieved with <code>md5 -q image.png</code></p>
  
  <p>I am however having a hard time trying to get the byte size of the image file. If I use <code>du -k image.png</code> command, it returns the size rounded up in kilo bytes. So for example if the actual size is 5722 bytes, <code>du</code> will return 8 (as in 8K or 8192 bytes) which is not correct. And the default for <code>du</code> is in 512 byte chunks but still rounds the value up (so it will return 16 instead of 8).</p>
  
  <p>I am running Lion OSX 10.7.4.</p>