file(C)


file -- determine file type

Syntax

file [ -achLs ] [ -f ffile ] [ -m mfile ] argument ...

Description

file performs a series of tests on each argument in an attempt to classify it.

The following options are supported:


-a
Reset the file access time to what it was prior to being accessed by file command. The invoking process must have write permission on the file.

-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.

-L
Follow symbolic links. If multiple -L and -h options are specified, all but the last is ignored.

-m mfile
Use mfile as the magic file.

-s
Print a less verbose report of ELF object file attributes.

-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:

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 9945-2:1992, Information technology - Portable Operating System Interface (POSIX) - Part 2: Shell and Utilities (IEEE Std 1003.2-1992);
AT&T SVID Issue 2;
X/Open CAE Specification, Commands and Utilities, Issue 4, 1992.


© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005