file-determines the type of a file by looking at its contents

 <  Day Day Up  >  

file ”determines the type of a file by looking at its contents

 file [[ f ffile ] [ cl ] [ m mfile ] filename... 

file performs a series of tests on each filename in an attempt to determine what it contains. If the contents of the file appear to be ASCII text, file examines the first 512 bytes and tries to guess its language.

Example A.26.
 1   file bin/ls  /bin/ls:      sparc pure dynamically linked executable  2   file go  go:      executable shell script  3   file junk  junk:      English text  

EXPLANATION

  1. ls is a binary file dynamically linked when executed.

  2. go is an executable shell script.

  3. junk is a file containing ASCII text.

 <  Day Day Up  >  


UNIX Shells by Example
UNIX Shells by Example (4th Edition)
ISBN: 013147572X
EAN: 2147483647
Year: 2004
Pages: 454
Authors: Ellie Quigley

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net