January 2003
Intermediate to advanced
832 pages
32h 40m
English
file
file [options]files
Classify the named files according to the type
of data they contain. file checks the magic file
(/etc/magic) to identify some file types.
-c
Check the format of the magic file (files
argument is invalid with -c). Usually used with
-m.
-f
file
Read the names of files to be checked from file.
-L
Follow symbolic links. By default, symbolic links are not followed.
-m
file
Search for file types in file instead of /etc/magic.
-v
Print the version.
-z
Attempt checking of compressed files.
Many file types are understood. Output lists each filename, followed by a brief classification such as:
Apple QuickTime movie file (moov) ASCII text data directory gzip compressed data empty PDF document, version 1.4 Mach-O executable ppc sticky symbolic link to private/tmp
List all PDF Version 1.1 files:
file * | grep "PDF document, version 1.1"