DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

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.

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:

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.


© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003