File tests each argument in an attempt to classify it.
The first test that succeeds causes the file type to be printed. The program checks to see if the file is empty, or if it's some sort of special file. The magic number tests are used to check for files with data in particular fixed formats. Any file with some invariant identifier at a small fixed offset into the file can usually be described in this way. These tests are less reliable than the previous two groups, so they are performed last.