file(C)
file --
determine file type
Syntax
file [ -ch ] [ -f ffile ]
[ -m mfile ] argument ...
Description
file performs a series of tests on each argument
in an attempt to classify it.
-
If argument appears to be an ASCII file,
file examines the first 512 bytes
and tries to guess its language.
-
If argument is an executable file (see
a.out(FP)),
file prints the version stamp,
provided it is greater than 0.
If this is a ELF executable file,
file also reports
whether the file is dynamically or statically linked,
whether the executable was stripped,
and whether the file contains debug information.
-
If argument is a
core(FP)
file,
file identifies the command line
that created the core file
and the time that command was invoked.
The following options are supported:
-c-
Check the
magic(F)
file for format errors. This validation is not normally carried out
for reasons of efficiency. No file typing is performed under this
option.
-f ffile-
Take ffile to be a file containing the names of the files
to be examined.
-h-
Do not follow symbolic links. By default, file follows
symbolic links.
-m mfile-
Use mfile as the magic file.
-x-
Do not report information about the process
that generated a core file
or detailed information about elf object and executable files.
file uses the file /etc/magic to identify files
that have some sort of ``magic number''; that is, any file
containing a numeric or string constant that indicates its type.
The
magic(F)
manual page and the commentary at the beginning of
/etc/magic explain its format.
Exit values
file returns the following values:
0-
successful completion
>0-
an error occurred
Differences between versions
The following features are supported
only for SCO OpenServer Release 5.0.6 and later releases:
-
Display information for a core file
identifying the command line that created it
and the time of invocation.
-
Display information about an elf object or executable file
identifying whether the file is linked dynamically or statically,
whether the executable was stripped,
and whether the file contains debug information.
Use the -x option to turn off these features
so that file reports the same information
as for earlier releases.
Files
/etc/magic-
database of magic numbers
/usr/lib/nls/support/Unix/fr_FR.ISO8859-1/Unix/magic-
localized database of magic numbers (French)
/usr/lib/nls/support/Unix/de_DE.ISO8859-1/Unix/magic-
localized database of magic numbers (German)
See also
filehdr(FP),
magic(F)
Standards conformance
file is conformant with:
ISO/IEC DIS 99452:1992, Information technology Portable Operating System Interface (POSIX) Part 2: Shell and Utilities (IEEE Std 1003.21992);
AT&T SVID Issue 2;
X/Open CAE Specification, Commands and Utilities, Issue 4, 1992.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003