file(1) DG/UX 5.4.2 file(1)
NAME
file - determine file type
SYNOPSIS
file [-h] [-m mfile] [-f ffile] arg ...
file [-h] [-m mfile] -f ffile
file -c [-m mfile]
DESCRIPTION
file performs a series of tests on each file supplied by arg and,
optionally, on each file supplied in ffile in an attempt to classify
it. If arg appears to be a text file, file examines the first 512
bytes and tries to guess its programming language. If arg is an
executable a.out, file prints the version stamp, provided it is
greater than 0. If arg is a symbolic link, by default the link is
followed and file tests the file that the symbolic link references.
-c Check the magic file for format errors. For reasons of
efficiency, this validation is normally not carried out.
-f ffile
ffile contains the names of the files to be examined.
-h Do not follow symbolic links.
-m mfile
Use mfile as an alternate magic file, instead of /etc/magic.
file uses /etc/magic to identify files that have a magic number. A
magic number is a numeric or string constant that indicates the file
type. Commentary at the beginning of /etc/magic explains its format.
International Features
file can classify files containing characters from supplementary code
sets. file reads each argument and can distinguish data files,
program text files, shell scripts and executable files as follows:
Files Classification
----------------------------------------------
Data files containing data
supplementary characters
Shell scripts containing command text
supplementary characters
Language program text files xxx text
containing literals or
comments using supplementary
characters
Executable files executable
Licensed material--property of copyright holder(s) 1
file(1) DG/UX 5.4.2 file(1)
EXAMPLES
$ file file1
file1: commands text
Since file1 contains DG/UX shell commands (i.e. it is a script file),
the file command gives the type as "commands text".
$ file -f filenames
file1: commands text
file2: ascii text
file3: c program text
file4: DG m88k pure executable
The file filenames contained the names of four files.
FILES
/etc/magic
DIAGNOSTICS
If the -h option is specified and arg is a symbolic link, file prints
the error message:
symbolic link to arg
SEE ALSO
filehdr(4).
Licensed material--property of copyright holder(s) 2