file — Tests each argument in an attempt to classify it.
file
[-i, --mime] [--help] [--version] filename
...
-i, --mime
Causes the file command to output mime type strings rather than the more traditional human readable ones.
--help
Display short helptext and exit
--version
Display commands version and exit
filename
Name of file to checksum
The file command examines a given file and tries to determine the files type. The underlying detection code is the same as that used by ABLE when determining how to load and execute files, this is useful if the user wishes to check ABLE is correctly determining a files type. Section 6.6, “How ABLE identifies files.” has more information on the detection method.
Example 13.3. Using the file command to determine filetypes
>file (hd0)/boot/vmlinuz-2.6.13-simtec1 (hd0)/boot/vmlinuz-2.6.13-simtec1: Linux Kernel >file (tftpboot)test.sh (tftpboot)test.sh: shell >file (tftpboot)srec (tftpboot)srec: Motorola S Record >file (hd0)/etc/services (hd0)/etc/services: data >file (hd0)/bin/ls (hd0)/etc/services (hd0)/boot/vmlinuz-2.6.13-simtec1 (hd0)/bin/ls: elf (hd0)/etc/services: ASCII text (hd0)/boot/vmlinuz-2.6.13-simtec1: Linux Kernel >file -i (hd0)/bin/ls (hd0)/etc/services (hd0)/boot/vmlinuz-2.6.13-simtec1 (hd0)/bin/ls: application/x-executable (hd0)/etc/services: text/plain (hd0)/boot/vmlinuz-2.6.13-simtec1: application/octet-stream >