FILE(1) User Commands FILE(1)

file - determine file type

file [-h] [-m mfile] [-f ffile] [-z] arg ...
file [-h] [-m mfile] [-z] -f ffile
file [-c] [-m mfile]

File performs a series of tests on each argument in an attempt to classify it. If an argument appears to be ascii, file examines the first 512 bytes and tries to guess its language.

File formats identified by a magic number (that is a defined value at a defined place of the file) are detected using the definitions in a magic file (/usr/5lib/magic by default).

The file command accepts the following options:

Complain about format errors in the magic file and display a summary of the magic known after reading.
The file given contains the names of other files to be examined, one file name per line.
Symbolic links are normally followed. This option causes file not to follow symbolic links but to print their target instead.
Use mfile instead of /usr/5lib/magic as the magic file.
If a file turns out to be compressed with compress(1), gzip(1), or bzip2(1), do not further examine the file itself but run the appropriate decompression program and examine its output. This option is an extension.

/usr/5lib/magic

Causes the text of some messages to be changed.

File often makes mistakes. In particular it often suggests that command files are C programs.

File does not currently accept the -d, -i, -M file, and -m file options from POSIX.1-2001.

2/6/05 Heirloom Toolchest