file 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. .TH FILE 1
  2. .SH NAME
  3. file \- determine file type
  4. .SH SYNOPSIS
  5. .B file
  6. [
  7. .B -m
  8. ]
  9. [
  10. .I file
  11. \&...
  12. ]
  13. .SH DESCRIPTION
  14. .I File
  15. performs a series of tests on its argument
  16. .I files
  17. in an attempt to classify their contents by language or purpose.
  18. If no arguments are given, the classification is performed
  19. on standard input.
  20. .PP
  21. If the
  22. .B -m
  23. flag is given,
  24. .I file
  25. outputs an
  26. appropriate MIME
  27. .B Content-Type
  28. specification describing the
  29. .B type
  30. and
  31. .B subtype
  32. of each file.
  33. .PP
  34. The file types it looks for include
  35. directory,
  36. device file,
  37. zero-filled file,
  38. empty file,
  39. Plan 9 executable,
  40. PAC audio file,
  41. .B cpio
  42. archive,
  43. .B tex
  44. .B dvi
  45. file,
  46. archive symbol table,
  47. archive,
  48. .B rc
  49. script,
  50. .B sh
  51. script,
  52. PostScript,
  53. .B troff
  54. output file for various devices,
  55. mail box,
  56. GIF,
  57. FAX,
  58. object code,
  59. C and Alef source,
  60. assembler source,
  61. compressed files,
  62. encrypted file,
  63. English text,
  64. compressed image,
  65. image,
  66. subfont,
  67. and
  68. font.
  69. .PP
  70. If a file has no apparent format,
  71. .I file
  72. looks at the character set it uses to classify it according to
  73. .SM ASCII\c
  74. ,
  75. extended
  76. .SM ASCII\c
  77. , Latin
  78. .SM ASCII\c
  79. , or
  80. .SM UTF
  81. holding one or more of the following blocks of the Unicode Standard:
  82. Extended Latin,
  83. Greek,
  84. Cyrillic,
  85. Armenian,
  86. Hebrew,
  87. Arabic,
  88. Devanagari,
  89. Bengali,
  90. Gurmukhi,
  91. Gujarati,
  92. Oriya,
  93. Tamil,
  94. Telugu,
  95. Kannada,
  96. Malayalam,
  97. Thai,
  98. Lao,
  99. Tibetan,
  100. Georgian,
  101. Japanese,
  102. Chinese,
  103. or Korean.
  104. .PP
  105. If all else fails,
  106. .I file
  107. decides its input is
  108. binary.
  109. .SH SOURCE
  110. .B /sys/src/cmd/file.c
  111. .SH BUGS
  112. It can make mistakes, for example classifying a file of decimal data,
  113. .LR .01 ,
  114. .LR .02 ,
  115. etc. as
  116. .IR troff (1)
  117. input.