title: how to extract specific bytes from a file using unix
body: <p>how do I extract 12byte chunks from a binary file at certain positions within the file.</p>
  
  <p>If I wanted to extract the first 12 bytes I could do something like</p>
  
  <pre><code>head -c12 file.bin&gt;output
  </code></pre>
  
  <p>If I wanted to extract 12 bytes from byte61 I could do something like</p>
  
  <pre><code>head -c72 file.bin|tail -c12 &gt;output
  </code></pre>
  
  <p>Is there a simpler way if I have something like 20 12byte chunks I need to extract</p>
  
  <p>thanks</p>