FILE(1) — NEWS-OS Programmer’s Manual
NAME
file − determine the type of a file by examining its contents
SYNOPSIS
file [ −c ] [ −f ffile ] [ −m ] filename ...
DESCRIPTION
file command performs a series of tests on each filename in an attempt to classify the type. If the contents of the file appear to be ASCII text, file command examines the first 1024 bytes to determine what languages are used. If the file is an executable file, a.out, file command displays CPU type, 68k or mips. If the file is a symbolic link, file command displays the name and the type of the file that are referenced by the link as follows,
symbolic link to filname of type
Each file, usually at the beginning, has a magic number, a numeric or string constant, to indicate its file type. file command uses the file /etc/magic to classify type of each file according to its magic number.
OPTIONS
−c Check the format errors in the magic number file. For the reasons of efficiency, this validation is not normally carried out. No file type-checking is done under −c option.
−f ffile Classify the types of files specified in ffile.
−m mfile Use mfile as an alternate magic number file.
MULTIPLE LANGUAGE SUPPORT
If the file is one of JIS, Shift-JIS, EUC, TCA(The Republic of China), or Mail code, file command classify the code type. JIS code and Mail code are identified using the following escape sequences:
ESC $ @JIS C 6226-1978 Kanji character-set
ESC $ BJIS X 0208-1983 Kanji character-set
ESC ( BASCII (ANSI X3.4-1986)
ESC ( JJIS X 0201-1976 JIS Roman character-set
ESC ( IJIS X 0201-1976 JIS Katakana character-set
ESC ( HSwedish character-set (often JIS Roman character set)
ESC $ ( CKorean character-set (KS C 5601-1987)
ESC $ ( 0, ESC $ ( 1, ESC $ ( ?
The Repubic of China character-set (CNS 11643-1986)
IDENTIFY FILE TYPE
• File status report
symbolic link to [file name]
character special (Major/Minor)
block special (Major/Minor)
directory
fifo
socket
• File contents (magic number file independent)
empty
executable script for /bin/csh
executable script for /bin/sh
c-shell commands
shell commands
sccs
RCS file
PRESS file
data
c program text
fortran program text
assembler program text
[nt]roff, tbl, or eqn input text
troff (CAT) output
commands text
troff intermediate output text
english text
ascii text
• File contents (magic number file dependent)
cpio archive
ASCII cpio archive
very old archive
apl workspace
packed data
System V Rel.1 ar archive
current ar archive
pdp11/pre System V vax executable
unix-rt ldp
pdp11 overlay
pdp11/pre System V vax pure executable
demand-page executable
pdp11 separate I&D
pdp11 kernel overlay
vax executable
vax pure executable
basic-16 executable
basic-16 executable (TV)
x86 executable
x86 executable (TV)
3b20 executable
3b20 executable (TV)
3b2/3b5 executable
3b2/3b5 executable (TV)
MC68k executable
MC68k executable (shared)
MC68k executable (shared demand paged)
68k executable
68k pure executable
68k demand paged pure executable
PostScript document
Frame Maker document
Frame Maker MIF file
Frame Maker MML file
MIPS endian big executable
MIPS endian big pure
MIPS endian big demand paged
MIPS endian little executable
MIPS endian little pure
MIPS endian little demand paged
swapped MIPS-eb executable
swapped MIPS-eb pure
swapped MIPS-eb demand paged
swapped MIPS-el executable
swapped MIPS-el pure
swapped MIPS-el demand paged
MIPS endian big ucode
MIPS endian little ucode
MS-DOS library
Microsoft x.out
old Microsoft 8086 x.out
BSD archive random library
MIPS archive
archive
compressed data
SONY multi media format
CDFF file
FILES
/etc/magicmagic number file
SEE ALSO
BUGS
It often makes mistakes. In particular, it often suggests that command files are C programs.
Does not recognize Pascal or LISP.
NEWS-OSRelease 4.2.1R