sometimes, we got a BIG file, but we don’t know its file type. so we need to use a tool to peek the very first bytes of the file to find out its file type.
but the file is too big to the normal text editor, i have to wait for a long time!
P.S. I need tools, not the code.
The tools on any reasonable *nix box are:
file: knows a lot of magic headers and detects the type of a file.head: reads first several lines or bytes of a file.tail: reads last several bytes or lines of a file; some files have metainfo at the end.