file -- Try to determine the FILE type.

Summary:

File tests each argument in an attempt to classify it. There are 3
sets of tests, performed in this order: File System Test, Magic 
Number Test, and Language Test.

File System test will examine the return value of the stat(2) system
call, to see if the file is empty, or a special file (block, char,
pipe, dir, link, socket,..).

Magic Number test will try to match the file with particular fixed
formats. For example, a binary executable files will have magic number
in some fixed position to indicate the OS, that file is executable.
Few standard data files also following the magic number concept.

Language Test will try to find the file char set like ASCII, UTF-8,
ISO-8859-x, etc,. Once file has determined the character set used in a
text-type file, it will attempt to determine in what (prg) language
the file is written.

Unidentified file will be classified as DATA file.

Example:

$ file myfile -- Print the file type.

$ file -b myfile -- Don't show the filename in the output.

$ file -f list -- Take the input filenames (one per line) from the 
                  file 'list'.

$ file -k myfile -- Print all matches. 

$ file -z myfile.tgz -- Try to look into compressed file.

$ file -i myfile -- Print the output in MIME format.

$ file -m mymagic myfile -- Use custom magic file.

# file -s /dev/hda? -- Take blk/char special files as an argument.

Read: man file

        manoj
-- 
Bill Dickey is learning me his experience. Yogi Berra in his rookie
season.
Manoj Srivastava <[EMAIL PROTECTED]> <http://www.debian.org/~srivasta/>  
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"NLUG" group.
To post to this group, send email to nlug-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/nlug-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to