Skip to content

Instantly share code, notes, and snippets.

@sroccaserra
Last active August 16, 2019 21:31
Show Gist options
  • Select an option

  • Save sroccaserra/0472724a37cea59d44a7bc4ceea3068c to your computer and use it in GitHub Desktop.

Select an option

Save sroccaserra/0472724a37cea59d44a7bc4ceea3068c to your computer and use it in GitHub Desktop.
Filter files by header, extract two bytes of its header, and make stats on that

Note: here I use gxargs and ggrep instead of xargs and grep commands because my OS does not come with GNU xargs and GNU grep by default.

$ find . -type f -not -name '*.aiff' -not -name '*.8svx' -print0 | \
    gxargs -r0 ggrep -bZl '^FORM' | \
    gxargs -0n1 xxd -p -s32 -l2 | \
    sort | uniq -c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment