title: How to append a number of bytes to the end of file
body: <p>NAND flash device has Block size 16384, page size 512, OOB size 16 bytes. 
  A partition dump (cleaned from OOB data) is 13548080 bytes in size, so its not multiple of 512. Since all writes must be 512 byte aligned, and the blob size must be a multiple of 512 bytes, I should to add <em>'n'</em> bytes at the end of the binary (fill with 'FF').
  13548080 bytes is incomplete 26462 pages. A complete 26462 pages is 26462 x 512 = 13548544 bytes. The difference is 464 bytes that I need to add.</p>
  
  <p>I tried two step way: first, I created 464 bytes padded.bin file <code>dd if=/dev/zero bs=1 count=464 | tr '\000' '\377' &gt;padded.bin</code>, then appended the original file to padded file:<code>dd if=padded.bin bs=1 count=464 &gt;&gt;original.bin</code></p>
  
  <p>Perhaps there is another way to append n bytes at the end of file use shell command?</p>