magic(5) definition for first 2kb of a file (FreeBSD/MacOS)
Scott Edwards
supadupa at gmail.com
Thu Nov 17 21:20:54 MST 2011
On Thu, Nov 17, 2011 at 10:16 PM, Scott Edwards <supadupa at gmail.com> wrote:
> ...
snip
> I'm almost ready to cheat and use this instead:
>
> zcat file.txt | head -c 2048 | tail -c 1024 | grep -o "quick brown fox"
>
> I'm tinkering with file magic first just to see. I've thought of using
> this approach no few times in the past but chicken out with a script etc.
>
>
I decided to use a regex construct for now. Eg:
5 regex/ quick\ brown\ fox QBF aka lazy dog troll.
Regards,
Scott.
More information about the PLUG
mailing list