file(1)
NAME
file − determine file type
SYNTAX
file [ −c ] [ −f ffile] [ −m mfile] filename ...
DESCRIPTION
The file command performs a series of tests on each filename argument in an attempt to classify it. If an argument appears to be ASCII, the file command examines the first 1024 bytes and tries to guess its language.
For character special files, part of this classification is information about which devices the system shows as active. In particular, device-specific information such as controller type and unit, device type and unit, and status (offline, write locked, density, errors) is returned. The general categories currently implemented are disk, tape, and terminal devices. The supported terminal devices include Local Area Terminals (LAT) but not Local Area Network (LAN) pseudo-terminals.
The file command uses the file /usr/lib/file/magic to identify files that have some sort of magic number. A magic number is any numeric or string constant that identifies the file containing the constant. Commentary at the beginning of /usr/lib/file/magic explains its format.
OPTIONS
−cChecks the magic file for format errors by printing the internal representation of the magic file. No file typing is done under −c.
−fInterprets the following argument to be a file containing the names of the files to be examined.
−mInstructs file to use an alternate magic file.
RESTRICTIONS
It often does a poor job of distinguishing C programs, shell scripts, English text, and ASCII text.
It does not recognize many programming languages, including Modula, Pascal, and Lisp.
FILES
/usr/lib/file/magic
SEE ALSO
Commands