FILE(1)                                                   FILE(1)

     NAME
          file - determine file type

     SYNOPSIS
          file [ -m ] [ file ...  ]

     DESCRIPTION
          File performs a series of tests on its argument files in an
          attempt to classify their contents by language or purpose.
          If no arguments are given, the classification is performed
          on standard input.

          If the -m flag is given, file outputs an appropriate MIME
          Content-Type specification describing the type and subtype
          of each file.

          The file types it looks for include directory, device file,
          zero-filled file, empty file, Plan 9 executable, PAC audio
          file, cpio archive, tex dvi file, archive symbol table,
          archive, rc script, sh script, PostScript, troff output file
          for various devices, GIF, FAX, object code, C and Alef
          source, assembler source, compressed files, encrypted file,
          English text, compressed image, image, subfont, and font.

          If a file has no apparent format, file looks at the charac-
          ter set it uses to classify it according to ASCII, extended
          ASCII, Latin ASCII, or UTF holding one or more of the fol-
          lowing blocks of the Unicode Standard: Extended Latin,
          Greek, Cyrillic, Armenian, Hebrew, Arabic, Devanagari, Ben-
          gali, Gurmukhi, Gujarati, Oriya, Tamil, Telugu, Kannada,
          Malayalam, Thai, Lao, Tibetan, Georgian, Japanese, Chinese,
          or Korean.

          If all else fails, file decides its input is binary.

     SOURCE
          /sys/src/cmd/file.c

     BUGS
          It can make mistakes, for example classifying a file of dec-
          imal data, `.01', `.02', etc. as troff(1) input.

     Page 1                       Plan 9            (printed 11/22/24)