title: How to list the first or last 10 lines from a file without decompressing it in linux
body: <p>I have a <code>.bz2</code> file. I want to list the first or last 10 lines without decompress it as it is too big. I tried the <code>head -10</code> or <code>tail -10</code> but I see gibberish. I also need to compare two compressed file to check if they are similar or not. how to achieve this without decompressing the files ?</p>
  
  <p>EDIT: Similar means identical (have the same content).</p>