Skip to content

Instantly share code, notes, and snippets.

@BrianRossmajer
Last active December 19, 2015 05:48
Show Gist options
  • Save BrianRossmajer/5906386 to your computer and use it in GitHub Desktop.
Save BrianRossmajer/5906386 to your computer and use it in GitHub Desktop.
This gist tests if a bzip file is complete. Since bzip2 --test actually decompresses the file (it's a real file test) it takes time and CPU. This shell snippet just looks for the bzip2 end-of-stream marker (See http://en.wikipedia.org/wiki/Bzip2#File_format). This was helpful when I was rsync'ing a directory of large bzip2 files over an unreliab…
tail -c 12 filename.bz2 |od -t xC| sed 's/ //g' | grep -q -E '2ee48a70a120|177245385090|5dc914e14240|bb9229c28480'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment