a2p
accept
access
acct
addftinfo
addr2line
adjtime
afmtodit
after
aio_cancel
aio_error
aio_read
aio_return
aio_suspend
aio_waitcomplete
aio_write
alias
aliases
alloc
anvil
append
apply
apropos
ar
array
as
asa
asn1parse
at
atq
atrm
attemptckalloc
attemptckrealloc
authlib
authtest
autopoint
awk
b64decode
b64encode
basename
batch
bc
bdes
bell
bg
bgerror
biff
big5
binary
bind
bindkey
bindtags
bindtextdomain
bio
bitmap
blowfish
bn
bootparams
bootptab
bounce
brandelf
break
breaksw
brk
bsdiff
bsdtar
bsnmpd
bspatch
bthost
btsockstat
buffer
builtin
builtins
bunzip2
button
byacc
bzcat
bzegrep
bzfgrep
bzgrep
bzip2
c2ph
c89
c99
ca
cal
calendar
canvas
cap_mkdb
case
cat
catch
catman
cc
cd
cdcontrol
chdir
checkbutton
checknr
chflags
chfn
chgrp
chio
chkey
chmod
chown
chpass
chroot
chsh
ci
ciphers
ckalloc
ckdist
ckfree
ckrealloc
cksum
cleanup
clear
clipboard
clock
clock_getres
clock_gettime
clock_settime
close
cmp
co
col
colcrt
colldef
colors
colrm
column
comm
command
compile_et
complete
compress
concat
config
connect
console
continue
core
courierlogger
couriertcpd
cp
cpan
cpio
cpp
creat
crl
crontab
crunchgen
crunchide
crypt
crypto
csh
csplit
ctags
ctm
ctm_dequeue
ctm_rmail
ctm_smail
cu
cursor
cursors
cut
cvs
date
dbiprof
dbiproxy
dc
dcgettext
dcngettext
dd
dde
default
defer
deliverquota
des
destroy
devfs
df
dgettext
dgst
dh
dhparam
dialog
diff
diff3
dig
dir
dirent
dirname
dirs
discard
disktab
dngettext
do
domainname
done
dprofpp
dsa
dsaparam
dtmfdecode
du
dup
dup2
eaccess
ec
ecdsa
echo
echotc
ecparam
ed
edit
editrc
ee
egrep
elf
elfdump
elif
else
enc
enc2xs
encoding
end
endif
endsw
engine
enigma
entry
env
envsubst
eof
eqn
err
errno
error
errstr
esac
ethers
euc
eui64
eval
event
evp
ex
exec
execve
exit
expand
export
exports
expr
extattr
extattr_delete_fd
extattr_delete_file
extattr_get_fd
extattr_get_file
extattr_set_fd
extattr_set_file
f77
false
famm
famx
fblocked
fbtab
fc
fchdir
fchflags
fchmod
fchown
fcntl
fconfigure
fcopy
fdescfs
fdformat
fdread
fdwrite
fetch
fg
fgrep
fhopen
fhstat
fhstatfs
fi
file
file2c
fileevent
filename
filetest
find
find2perl
finger
flex
flock
flush
fmt
focus
fold
font
fontedit
for
foreach
fork
format
forward
fpathconf
frame
from
fs
fstab
fstat
fstatfs
fsync
ftp
ftpchroot
ftpusers
ftruncate
futimes
g711conv
gb2312
gb18030
gbk
gcc
gcore
gcov
gdb
gencat
gendsa
genrsa
gensnmptree
getconf
getdents
getdirentries
getdtablesize
getegid
geteuid
getfacl
getfh
getfsstat
getgid
getgroups
getitimer
getlogin
getopt
getopts
getpeername
getpgid
getpgrp
getpid
getppid
getpriority
getresgid
getresuid
getrlimit
getrusage
gets
getsid
getsockname
getsockopt
gettext
gettextize
gettimeofday
gettytab
getuid
glob
global
gmake
goto
gperf
gprof
grab
grep
grid
grn
grodvi
groff
groff_font
groff_out
groff_tmac
grog
grolbp
grolj4
grops
grotty
group
groups
gunzip
gzcat
gzexe
gzip
h2ph
h2xs
hash
hashstat
hd
head
help2man
hesinfo
hexdump
history
host
hostname
hosts
hosts_access
hosts_options
hpftodit
http
hup
i386_get_ioperm
i386_get_ldt
i386_set_ioperm
i386_set_ldt
i386_vm86
iconv
id
ident
idprio
if
ifnames253
ifnames259
image
imapd
incr
indent
indxbib
info
infokey
inode
install
instmodsh
interp
intro
introduction
ioctl
ipcrm
ipcs
ipf
ipftest
ipnat
ippool
ipresend
issetugid
jail
jail_attach
jobid
jobs
join
jot
kbdcontrol
kbdmap
kcon
kdestroy
kdump
kenv
kevent
keycap
keylogin
keylogout
keymap
keysyms
kgdb
kill
killall
killpg
kinit
kldfind
kldfirstmod
kldload
kldnext
kldstat
kldsym
kldunload
klist
kpasswd
kqueue
kse
kse_create
kse_exit
kse_release
kse_switchin
kse_thr_interrupt
kse_wakeup
ktrace
label
labelframe
lam
lappend
last
lastcomm
lastlog
lchflags
lchmod
lchown
ld
ldap
ldapadd
ldapcompare
ldapdelete
ldapmodify
ldapmodrdn
ldappasswd
ldapsearch
ldapwhoami
ldd
leave
less
lesskey
lex
lgetfh
lhash
libnetcfg
library
limit
limits
lindex
link
linprocfs
linsert
lint
lio_listio
list
listbox
listen
lj4_font
lkbib
llength
lmtp
ln
load
loadfont
local
locale
locate
lock
lockf
log
logger
login
logins
logname
logout
look
lookbib
lorder
lower
lp
lpq
lpr
lprm
lptest
lrange
lreplace
ls
lsearch
lseek
lset
lsort
lstat
lsvfs
lutimes
lynx
m4
madvise
magic
mail
maildiracl
maildirkw
maildirmake
mailq
mailx
make
makeinfo
makewhatis
man
manpath
master
mc
mcedit
mcview
md2
md4
md5
mdc2
memory
menu
menubar
menubutton
merge
mesg
message
mincore
minherit
minigzip
mkdep
mkdir
mkfifo
mkimapdcert
mklocale
mknod
mkpop3dcert
mkstr
mktemp
mlock
mlockall
mmap
mmroff
modfind
modfnext
modnext
modstat
moduli
more
motd
mount
mprotect
mptable
msdos
msdosfs
msgattrib
msgcat
msgcmp
msgcomm
msgconv
msgen
msgexec
msgfilter
msgfmt
msggrep
msginit
msgmerge
msgs
msgunfmt
msguniq
mskanji
msql2mysql
msync
mt
munlock
munlockall
munmap
mv
myisamchk
myisamlog
myisampack
mysql
mysqlaccess
mysqladmin
mysqlbinlog
mysqlcheck
mysqld
mysqldump
mysqld_multi
mysqld_safe
mysqlhotcopy
mysqlimport
mysqlshow
mysql_config
mysql_fix_privilege_tables
mysql_zap
namespace
nanosleep
nawk
nc
ncal
ncplist
ncplogin
ncplogout
neqn
netconfig
netgroup
netid
netstat
networks
newaliases
newgrp
nex
nfsstat
nfssvc
ngettext
nice
nl
nm
nmount
nohup
nologin
notify
nroff
nseq
nslookup
ntp_adjtime
ntp_gettime
nvi
nview
objcopy
objdump
objformat
ocsp
od
onintr
open
openssl
opieaccess
opieinfo
opiekey
opiekeys
opiepasswd
option
options
oqmgr
pack
package
packagens
pagesize
palette
pam_auth
panedwindow
parray
passwd
paste
patch
pathchk
pathconf
pawd
pax
pbm
pcre
pcreapi
pcrebuild
pcrecallout
pcrecompat
pcrecpp
pcregrep
pcrematching
pcrepartial
pcrepattern
pcreperform
pcreposix
pcreprecompile
pcresample
pcretest
perl
perl56delta
perl58delta
perl561delta
perl570delta
perl571delta
perl572delta
perl573delta
perl581delta
perl582delta
perl583delta
perl584delta
perl585delta
perl586delta
perl587delta
perl588delta
perl5004delta
perl5005delta
perlaix
perlamiga
perlapi
perlapio
perlapollo
perlartistic
perlbeos
perlbook
perlboot
perlbot
perlbs2000
perlbug
perlcall
perlcc
perlce
perlcheat
perlclib
perlcn
perlcompile
perlcygwin
perldata
perldbmfilter
perldebguts
perldebtut
perldebug
perldelta
perldgux
perldiag
perldoc
perldos
perldsc
perlebcdic
perlembed
perlepoc
perlfaq
perlfaq1
perlfaq2
perlfaq3
perlfaq4
perlfaq5
perlfaq6
perlfaq7
perlfaq8
perlfaq9
perlfilter
perlfork
perlform
perlfreebsd
perlfunc
perlglossary
perlgpl
perlguts
perlhack
perlhist
perlhpux
perlhurd
perlintern
perlintro
perliol
perlipc
perlirix
perlivp
perljp
perlko
perllexwarn
perllinux
perllocale
perllol
perlmachten
perlmacos
perlmacosx
perlmint
perlmod
perlmodinstall
perlmodlib
perlmodstyle
perlmpeix
perlnetware
perlnewmod
perlnumber
perlobj
perlop
perlopenbsd
perlopentut
perlos2
perlos390
perlos400
perlothrtut
perlpacktut
perlplan9
perlpod
perlpodspec
perlport
perlqnx
perlre
perlref
perlreftut
perlrequick
perlreref
perlretut
perlrun
perlsec
perlsolaris
perlstyle
perlsub
perlsyn
perlthrtut
perltie
perltoc
perltodo
perltooc
perltoot
perltrap
perltru64
perltw
perlunicode
perluniintro
perlutil
perluts
perlvar
perlvmesa
perlvms
perlvos
perlwin32
perlxs
perlxstut
perror
pfbtops
pftp
pgrep
phones
photo
pic
pickup
piconv
pid
pipe
pkcs7
pkcs8
pkcs12
pkg_add
pkg_check
pkg_create
pkg_delete
pkg_info
pkg_sign
pkg_version
pkill
pl2pm
place
pod2html
pod2latex
pod2man
pod2text
pod2usage
podchecker
podselect
poll
popd
popup
posix_madvise
postalias
postcat
postconf
postdrop
postfix
postkick
postlock
postlog
postmap
postqueue
postsuper
pr
pread
preadv
printcap
printenv
printf
proc
procfs
profil
protocols
prove
proxymap
ps
psed
psroff
pstruct
ptrace
publickey
pushd
puts
pwd
pwrite
pwritev
qmgr
qmqpd
quota
quotactl
radiobutton
raise
rand
ranlib
rcp
rcs
rcsclean
rcsdiff
rcsfile
rcsfreeze
rcsintro
rcsmerge
read
readelf
readlink
readonly
readv
realpath
reboot
recv
recvfrom
recvmsg
red
ree
refer
regexp
registry
regsub
rehash
remote
rename
repeat
replace
req
reset
resolver
resource
return
rev
revoke
rfcomm_sppd
rfork
rhosts
ripemd
ripemd160
rlog
rlogin
rm
rmd160
rmdir
rpc
rpcgen
rs
rsa
rsautl
rsh
rtld
rtprio
rup
ruptime
rusers
rwall
rwho
s2p
safe
sasl
sasldblistusers2
saslpasswd2
sbrk
scache
scale
scan
sched
sched_getparam
sched_getscheduler
sched_get_priority_max
sched_get_priority_min
sched_rr_get_interval
sched_setparam
sched_setscheduler
sched_yield
scon
scp
script
scrollbar
sdiff
sed
seek
select
selection
semctl
semget
semop
send
sendbug
sendfile
sendmail
sendmsg
sendto
services
sess_id
set
setegid
setenv
seteuid
setfacl
setgid
setgroups
setitimer
setlogin
setpgid
setpgrp
setpriority
setregid
setresgid
setresuid
setreuid
setrlimit
setsid
setsockopt
settc
settimeofday
setty
setuid
setvar
sftp
sh
sha
sha1
sha256
shar
shells
shift
shmat
shmctl
shmdt
shmget
showq
shutdown
sigaction
sigaltstack
sigblock
sigmask
sigpause
sigpending
sigprocmask
sigreturn
sigsetmask
sigstack
sigsuspend
sigvec
sigwait
size
slapadd
slapcat
slapd
slapdn
slapindex
slappasswd
slaptest
sleep
slogin
slurpd
smbutil
smime
smtp
smtpd
socket
socketpair
sockstat
soelim
sort
source
spawn
speed
spinbox
spkac
splain
split
squid
squid_ldap_auth
squid_ldap_group
squid_unix_group
sscop
ssh
sshd_config
ssh_config
stab
startslip
stat
statfs
stop
string
strings
strip
stty
su
subst
sum
suspend
swapoff
swapon
switch
symlink
sync
sysarch
syscall
sysconftool
sysconftoolcheck
systat
s_client
s_server
s_time
tabs
tail
talk
tar
tbl
tclsh
tcltest
tclvars
tcopy
tcpdump
tcpslice
tcsh
tee
tell
telltc
telnet
term
termcap
terminfo
test
texindex
texinfo
text
textdomain
tfmtodit
tftp
then
threads
time
tip
tk
tkerror
tkvars
tkwait
tlsmgr
tmac
top
toplevel
touch
tput
tr
trace
trafshow
trap
troff
true
truncate
truss
tset
tsort
tty
ttys
type
tzfile
ui
ul
ulimit
umask
unalias
uname
uncomplete
uncompress
undelete
unexpand
unhash
unifdef
unifdefall
uniq
units
unknown
unlimit
unlink
unmount
unset
unsetenv
until
unvis
update
uplevel
uptime
upvar
usbhidaction
usbhidctl
users
utf8
utimes
utmp
utrace
uudecode
uuencode
uuidgen
vacation
variable
verify
version
vfork
vgrind
vgrindefs
vi
vidcontrol
vidfont
view
virtual
vis
vt220keys
vwait
w
wait
wait3
wait4
waitpid
wall
wc
wget
what
whatis
where
whereis
which
while
who
whoami
whois
window
winfo
wish
wm
write
writev
wtmp
x509
xargs
xgettext
xmlwf
xstr
xsubpp
yacc
yes
ypcat
ypchfn
ypchpass
ypchsh
ypmatch
yppasswd
ypwhich
yyfix
zcat
zcmp
zdiff
zegrep
zfgrep
zforce
zgrep
zmore
znew
_exit
__syscall
 
FreeBSD/Linux/UNIX General Commands Manual
Hypertext Man Pages
file
 
FILE(1) 		FreeBSD General Commands Manual 	       FILE(1)

NAME
     file -- determine file type

SYNOPSIS
     file [-bcikLnNprsvz] [-f namefile] [-F separator] [-m magicfiles]
	  file ...
     file -C [-m magicfile]

DESCRIPTION
     This manual page documents version 4.12 of the file utility which tests
     each argument in an attempt to classify it.  There are three sets of
     tests, performed in this order: file system tests, magic number tests,
     and language tests.  The first test that succeeds causes the file type to
     be printed.

     The type printed will usually contain one of the words ``text'' (the file
     contains only printing characters and a few common control characters and
     is probably safe to read on an ASCII terminal), ``executable'' (the file
     contains the result of compiling a program in a form understandable to
     some UNIX kernel or another), or ``data'' meaning anything else (data is
     usually `binary' or non-printable).  Exceptions are well-known file for-
     mats (core files, tar archives) that are known to contain binary data.
     When modifying the file /usr/share/misc/magic or the program itself,
     preserve these keywords.  People depend on knowing that all the readable
     files in a directory have the word ``text'' printed.  Do not do as Berke-
     ley did and change ``shell commands text'' to ``shell script''.  Note
     that the file /usr/share/misc/magic is built mechanically from a large
     number of small files in the subdirectory Magdir in the source distribu-
     tion of this program.

     The file system tests are based on examining the return from a stat(2)
     system call.  The program checks to see if the file is empty, or if it is
     some sort of special file.  Any known file types appropriate to the sys-
     tem you are running on (sockets, symbolic links, or named pipes (FIFOs)
     on those systems that implement them) are intuited if they are defined in
     the system header file <sys/stat.h>.

     The magic number tests are used to check for files with data in particu-
     lar fixed formats.  The canonical example of this is a binary executable
     (compiled program) a.out file, whose format is defined in <a.out.h> and
     possibly <exec.h> in the standard include directory.  These files have a
     `magic number' stored in a particular place near the beginning of the
     file that tells the UNIX operating system that the file is a binary exe-
     cutable, and which of several types thereof.  The concept of `magic
     number' has been applied by extension to data files.  Any file with some
     invariant identifier at a small fixed offset into the file can usually be
     described in this way.  The information identifying these files is read
     from the compiled magic file /usr/share/misc/magic.mgc, or
     /usr/share/misc/magic if the compile file does not exist.

     If a file does not match any of the entries in the magic file, it is
     examined to see if it seems to be a text file.  ASCII, ISO-8859-x, non-
     ISO 8-bit extended-ASCII character sets (such as those used on Macintosh
     and IBM PC systems), UTF-8-encoded Unicode, UTF-16-encoded Unicode, and
     EBCDIC character sets can be distinguished by the different ranges and
     sequences of bytes that constitute printable text in each set.  If a file
     passes any of these tests, its character set is reported.	ASCII,
     ISO-8859-x, UTF-8, and extended-ASCII files are identified as ``text''
     because they will be mostly readable on nearly any terminal; UTF-16 and
     EBCDIC are only ``character data'' because, while they contain text, it
     is text that will require translation before it can be read.  In addi-
     tion, file will attempt to determine other characteristics of text-type
     files.  If the lines of a file are terminated by CR, CRLF, or NEL,
     instead of the UNIX-standard LF, this will be reported.  Files that con-
     tain embedded escape sequences or overstriking will also be identified.

     Once file has determined the character set used in a text-type file, it
     will attempt to determine in what language the file is written.  The lan-
     guage tests look for particular strings (cf names.h) that can appear any-
     where in the first few blocks of a file.  For example, the keyword .br
     indicates that the file is most likely a troff(1) input file, just as the
     keyword struct indicates a C program.  These tests are less reliable than
     the previous two groups, so they are performed last.  The language test
     routines also test for some miscellany (such as tar(1) archives).

     Any file that cannot be identified as having been written in any of the
     character sets listed above is simply said to be ``data''.

OPTIONS
     -b, --brief
	     Do not prepend filenames to output lines (brief mode).

     -c, --checking-printout
	     Cause a checking printout of the parsed form of the magic file.
	     This is usually used in conjunction with -m to debug a new magic
	     file before installing it.

     -C, --compile
	     Write a magic.mgc output file that contains a pre-parsed version
	     of file.

     -f, --files-from namefile
	     Read the names of the files to be examined from namefile (one per
	     line) before the argument list.  Either namefile or at least one
	     filename argument must be present; to test the standard input,
	     use ``-'' as a filename argument.

     -F, --separator separator
	     Use the specified string as the separator between the filename
	     and the file result returned.  Defaults to `:'.

     -i, --mime
	     Causes the file command to output mime type strings rather than
	     the more traditional human readable ones.	Thus it may say
	     ``text/plain; charset=us-ascii'' rather than ``ASCII text''.  In
	     order for this option to work, file changes the way it handles
	     files recognised by the command itself (such as many of the text
	     file types, directories etc), and makes use of an alternative
	     magic file.  (See FILES section, below).

     -k, --keep-going
	     Do not stop at the first match, keep going.

     -L, --dereference
	     option causes symlinks to be followed, as the like-named option
	     in ls(1).	(on systems that support symbolic links).

     -m, --magic-file list
	     Specify an alternate list of files containing magic numbers.
	     This can be a single file, or a colon-separated list of files.
	     If a compiled magic file is found alongside, it will be used
	     instead.  With the -i or --mime option, the program adds .mime to
	     each file name.

     -n, --no-buffer
	     Force stdout to be flushed after checking each file.  This is
	     only useful if checking a list of files.  It is intended to be
	     used by programs that want filetype output from a pipe.

     -N, --no-pad
	     Do not pad filenames so that they align in the output.

     -p, --preserve-date
	     On systems that support utime(3) or utimes(2), attempt to pre-
	     serve the access time of files analyzed, to pretend that file
	     never read them.

     -r, --raw
	     Do not translate unprintable characters to \ooo.  Normally file
	     translates unprintable characters to their octal representation.

     -s, --special-files
	     Normally, file only attempts to read and determine the type of
	     argument files which stat(2) reports are ordinary files.  This
	     prevents problems, because reading special files may have pecu-
	     liar consequences.  Specifying the -s option causes file to also
	     read argument files which are block or character special files.
	     This is useful for determining the file system types of the data
	     in raw disk partitions, which are block special files.  This
	     option also causes file to disregard the file size as reported by
	     stat(2) since on some systems it reports a zero size for raw disk
	     partitions.

     -v, --version
	     Print the version of the program and exit.

     -z, --uncompress
	     Try to look inside compressed files.

     --help  Print a help message and exit.

FILES
     /usr/share/misc/magic.mgc	 Default compiled list of magic numbers
     /usr/share/misc/magic	 Default list of magic numbers
     /usr/share/misc/magic.mime.mgc
				 Default compiled list of magic numbers, used
				 to output mime types when the -i option is
				 specified.
     /usr/share/misc/magic.mime  Default list of magic numbers, used to output
				 mime types when the -i option is specified.
     /etc/magic 		 Local additions to magic wisdom.

ENVIRONMENT
     The environment variable MAGIC can be used to set the default magic num-
     ber file name.  file adds .mime and/or .mgc to the value of this variable
     as appropriate.

SEE ALSO
     hexdump(1), od(1), strings(1), magic(5)

STANDARDS CONFORMANCE
     This program is believed to exceed the System V Interface Definition,
     Fourth Edition (``SVID4'') of FILE(CMD), as near as one can determine
     from the vague language contained therein.  Its behaviour is mostly com-
     patible with the System V program of the same name.  This version knows
     more magic, however, so it will produce different (albeit more accurate)
     output in many cases.

     The one significant difference between this version and System V is that
     this version treats any white space as a delimiter, so that spaces in
     pattern strings must be escaped.  For example,

	   >10	string	  language impress    (imPRESS data)

     in an existing magic file would have to be changed to

	   >10	string	  language\ impress   (imPRESS data)

     In addition, in this version, if a pattern string contains a backslash,
     it must be escaped.  For example

	   0	string	       \begindata     Andrew Toolkit document

     in an existing magic file would have to be changed to

	   0	string	       \\begindata    Andrew Toolkit document

     SunOS releases 3.2 and later from Sun Microsystems include a file(1) com-
     mand derived from the System V one, but with some extensions.  My version
     differs from Sun's only in minor ways.  It includes the extension of the
     `&' operator, used as, for example,

	   >16	long&0x7fffffff     >0	      not stripped

MAGIC DIRECTORY
     The magic file entries have been collected from various sources, mainly
     USENET, and contributed by various authors.  Christos Zoulas (address
     below) will collect additional or corrected magic file entries.  A con-
     solidation of magic file entries will be distributed periodically.

     The order of entries in the magic file is significant.  Depending on what
     system you are using, the order that they are put together may be incor-
     rect.  If your old file command uses a magic file, keep the old magic
     file around for comparison purposes (rename it to
     /usr/share/misc/magic.orig).

EXAMPLES
     $ file file.c file /dev/{wd0a,hda}
     file.c:	C program text
     file:	ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
		dynamically linked (uses shared libs), stripped
     /dev/wd0a: block special (0/0)
     /dev/hda:	block special (3/0)
     $ file -s /dev/wd0{b,d}
     /dev/wd0b: data
     /dev/wd0d: x86 boot sector
     $ file -s /dev/hda{,1,2,3,4,5,6,7,8,9,10}
     /dev/hda:	 x86 boot sector
     /dev/hda1:  Linux/i386 ext2 filesystem
     /dev/hda2:  x86 boot sector
     /dev/hda3:  x86 boot sector, extended partition table
     /dev/hda4:  Linux/i386 ext2 filesystem
     /dev/hda5:  Linux/i386 swap file
     /dev/hda6:  Linux/i386 swap file
     /dev/hda7:  Linux/i386 swap file
     /dev/hda8:  Linux/i386 swap file
     /dev/hda9:  empty
     /dev/hda10: empty

     $ file -i file.c file /dev/{wd0a,hda}
     file.c:	text/x-c
     file:	application/x-executable, dynamically linked (uses shared libs),
		not stripped
     /dev/hda:	application/x-not-regular-file
     /dev/wd0a: application/x-not-regular-file

HISTORY
     There has been a file command in every UNIX since at least Research Ver-
     sion 4 (man page dated November, 1973).  The System V version introduced
     one significant major change: the external list of magic number types.
     This slowed the program down slightly but made it a lot more flexible.

     This program, based on the System V version, was written by Ian Darwin
      without looking at anybody else's source code.

     John Gilmore revised the code extensively, making it better than the
     first version.  Geoff Collyer found several inadequacies and provided
     some magic file entries.  Contributions by the `&' operator by Rob
     McMahon , 1989.

     Guy Harris , made many changes from 1993 to the present.

     Primary development and maintenance from 1990 to the present by Christos
     Zoulas .

     Altered by Chris Lowth , 2000: Handle the -i option to
     output mime type strings and using an alternative magic file and internal
     logic.

     Altered by Eric Fischer , July, 2000, to identify charac-
     ter codes and attempt to identify the languages of non-ASCII files.

     The list of contributors to the Magdir directory (source for the
     /usr/share/misc/magic file) is too long to include here.  You know who
     you are; thank you.

LEGAL NOTICE
     Copyright (c) Ian F. Darwin, Toronto, Canada, 1986-1999.  Covered by the
     standard Berkeley Software Distribution copyright; see the file
     LEGAL.NOTICE in the source distribution.

     The files tar.h and is_tar.c were written by John Gilmore from his pub-
     lic-domain tar program, and are not covered by the above license.

BUGS
     There must be a better way to automate the construction of the Magic file
     from all the glop in Magdir.  What is it?	Better yet, the magic file
     should be compiled into binary (say, ndbm(3) or, better yet, fixed-length
     ASCII strings for use in heterogenous network environments) for faster
     startup.  Then the program would run as fast as the Version 7 program of
     the same name, with the flexibility of the System V version.

     The file utility uses several algorithms that favor speed over accuracy,
     thus it can be misled about the contents of text files.

     The support for text files (primarily for programming languages) is sim-
     plistic, inefficient and requires recompilation to update.

     There should be an else clause to follow a series of continuation lines.

     The magic file and keywords should have regular expression support.
     Their use of ASCII TAB as a field delimiter is ugly and makes it hard to
     edit the files, but is entrenched.

     It might be advisable to allow upper-case letters in keywords for e.g.,
     troff(1) commands vs man page macros.  Regular expression support would
     make this easy.

     The program does not grok FORTRAN.  It should be able to figure FORTRAN
     by seeing some keywords which appear indented at the start of line.  Reg-
     ular expression support would make this easy.

     The list of keywords in ascmagic probably belongs in the Magic file.
     This could be done by using some keyword like `*' for the offset value.

     Another optimisation would be to sort the magic file so that we can just
     run down all the tests for the first byte, first word, first long, etc,
     once we have fetched it.  Complain about conflicts in the magic file
     entries.  Make a rule that the magic entries sort based on file offset
     rather than position within the magic file?

     The program should provide a way to give an estimate of ``how good'' a
     guess is.	We end up removing guesses (e.g. ``From '' as first 5 chars of
     file) because they are not as good as other guesses (e.g. ``Newsgroups:''
     versus ``Return-Path:'').	Still, if the others do not pan out, it should
     be possible to use the first guess.

     This program is slower than some vendors' file commands.  The new support
     for multiple character codes makes it even slower.

     This manual page, and particularly this section, is too long.

AVAILABILITY
     You can obtain the original author's latest version by anonymous FTP on
     ftp.astron.com in the directory /pub/file/file-X.YZ.tar.gz

FreeBSD 6.1		       October 27, 2003 		   FreeBSD 6.1
=2781
+1065
(328)