ManPageMtree5.wiki 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. MTREE(5) manual page
  2. == NAME ==
  3. '''mtree'''
  4. - format of mtree dir hierarchy files
  5. == DESCRIPTION ==
  6. The
  7. '''mtree'''
  8. format is a textual format that describes a collection of filesystem objects.
  9. Such files are typically used to create or verify directory hierarchies.
  10. === General Format===
  11. An
  12. '''mtree'''
  13. file consists of a series of lines, each providing information
  14. about a single filesystem object.
  15. Leading whitespace is always ignored.
  16. When encoding file or pathnames, any backslash character or
  17. character outside of the 95 printable ASCII characters must be
  18. encoded as a backslash followed by three
  19. octal digits.
  20. When reading mtree files, any appearance of a backslash
  21. followed by three octal digits should be converted into the
  22. corresponding character.
  23. Each line is interpreted independently as one of the following types:
  24. <dl>
  25. <dt>Blank</dt><dd>
  26. Blank lines are ignored.
  27. </dd><dt>Comment</dt><dd>
  28. Lines beginning with
  29. '''#'''
  30. are ignored.
  31. </dd><dt>Special</dt><dd>
  32. Lines beginning with
  33. '''/'''
  34. are special commands that influence
  35. the interpretation of later lines.
  36. </dd><dt>Relative</dt><dd>
  37. If the first whitespace-delimited word has no
  38. '''/'''
  39. characters,
  40. it is the name of a file in the current directory.
  41. Any relative entry that describes a directory changes the
  42. current directory.
  43. </dd><dt>dot-dot</dt><dd>
  44. As a special case, a relative entry with the filename
  45. ''..''
  46. changes the current directory to the parent directory.
  47. Options on dot-dot entries are always ignored.
  48. </dd><dt>Full</dt><dd>
  49. If the first whitespace-delimited word has a
  50. '''/'''
  51. character after
  52. the first character, it is the pathname of a file relative to the
  53. starting directory.
  54. There can be multiple full entries describing the same file.
  55. </dd></dl>
  56. Some tools that process
  57. '''mtree'''
  58. files may require that multiple lines describing the same file
  59. occur consecutively.
  60. It is not permitted for the same file to be mentioned using
  61. both a relative and a full file specification.
  62. === Special commands===
  63. Two special commands are currently defined:
  64. <dl>
  65. <dt>'''/set'''</dt><dd>
  66. This command defines default values for one or more keywords.
  67. It is followed on the same line by one or more whitespace-separated
  68. keyword definitions.
  69. These definitions apply to all following files that do not specify
  70. a value for that keyword.
  71. </dd><dt>'''/unset'''</dt><dd>
  72. This command removes any default value set by a previous
  73. '''/set'''
  74. command.
  75. It is followed on the same line by one or more keywords
  76. separated by whitespace.
  77. </dd></dl>
  78. === Keywords===
  79. After the filename, a full or relative entry consists of zero
  80. or more whitespace-separated keyword definitions.
  81. Each such definition consists of a key from the following
  82. list immediately followed by an '=' sign
  83. and a value.
  84. Software programs reading mtree files should warn about
  85. unrecognized keywords.
  86. Currently supported keywords are as follows:
  87. <dl>
  88. <dt>'''cksum'''</dt><dd>
  89. The checksum of the file using the default algorithm specified by
  90. the
  91. [[cksum(1)|http://www.freebsd.org/cgi/man.cgi?query=cksum&sektion=1]]
  92. utility.
  93. </dd><dt>'''device'''</dt><dd>
  94. The device number for
  95. .B block
  96. or
  97. .B char
  98. file types.
  99. The value must be one of the following forms:
  100. <dl>
  101. <dt>''format'',''major'',''minor''Bo,''subunit'' Bc</dt><dd>
  102. A device with
  103. ''major'', minor
  104. and optional
  105. ''subunit''
  106. fields.
  107. Their meaning is specified by the operating's system
  108. ''format''.
  109. See below for valid formats.
  110. </dd><dt>''number''</dt><dd>
  111. Opaque number (as stored on the file system).
  112. </dd></dl>
  113. The following values for
  114. ''format''
  115. are recognized:
  116. .B native ,
  117. .B 386bsd ,
  118. .B 4bsd ,
  119. .B bsdos ,
  120. .B freebsd ,
  121. .B hpux ,
  122. .B isc ,
  123. .B linux ,
  124. .B netbsd ,
  125. .B osf1 ,
  126. .B sco ,
  127. .B solaris ,
  128. .B sunos ,
  129. .B svr3 ,
  130. .B svr4 ,
  131. and
  132. .B ultrix .
  133. See
  134. [[mknod(8)|http://www.freebsd.org/cgi/man.cgi?query=mknod&sektion=8]]
  135. for more details.
  136. </dd><dt>'''contents'''</dt><dd>
  137. The full pathname of a file that holds the contents of this file.
  138. </dd><dt>'''flags'''</dt><dd>
  139. The file flags as a symbolic name.
  140. See
  141. [[chflags(1)|http://www.freebsd.org/cgi/man.cgi?query=chflags&sektion=1]]
  142. for information on these names.
  143. If no flags are to be set the string
  144. "none"
  145. may be used to override the current default.
  146. </dd><dt>'''gid'''</dt><dd>
  147. The file group as a numeric value.
  148. </dd><dt>'''gname'''</dt><dd>
  149. The file group as a symbolic name.
  150. </dd><dt>'''ignore'''</dt><dd>
  151. Ignore any file hierarchy below this file.
  152. </dd><dt>'''inode'''</dt><dd>
  153. The inode number.
  154. </dd><dt>'''link'''</dt><dd>
  155. The target of the symbolic link when type=link.
  156. </dd><dt>'''md5'''</dt><dd>
  157. The MD5 message digest of the file.
  158. </dd><dt>'''md5digest'''</dt><dd>
  159. A synonym for
  160. '''md5'''.
  161. </dd><dt>'''mode'''</dt><dd>
  162. The current file's permissions as a numeric (octal) or symbolic
  163. value.
  164. </dd><dt>'''nlink'''</dt><dd>
  165. The number of hard links the file is expected to have.
  166. </dd><dt>'''nochange'''</dt><dd>
  167. Make sure this file or directory exists but otherwise ignore all attributes.
  168. </dd><dt>'''optional'''</dt><dd>
  169. The file is optional; do not complain about the file if it is not in
  170. the file hierarchy.
  171. </dd><dt>'''resdevice'''</dt><dd>
  172. The
  173. "resident"
  174. device number of the file, e.g. the ID of the device that
  175. contains the file.
  176. Its format is the same as the one for
  177. '''device'''.
  178. </dd><dt>'''ripemd160digest'''</dt><dd>
  179. The
  180. '''RIPEMD160'''
  181. message digest of the file.
  182. </dd><dt>'''rmd160'''</dt><dd>
  183. A synonym for
  184. '''ripemd160digest'''.
  185. </dd><dt>'''rmd160digest'''</dt><dd>
  186. A synonym for
  187. '''ripemd160digest'''.
  188. </dd><dt>'''sha1'''</dt><dd>
  189. The
  190. '''FIPS'''
  191. 160-1
  192. ("Tn SHA-1")
  193. message digest of the file.
  194. </dd><dt>'''sha1digest'''</dt><dd>
  195. A synonym for
  196. '''sha1'''.
  197. </dd><dt>'''sha256'''</dt><dd>
  198. The
  199. '''FIPS'''
  200. 180-2
  201. ("Tn SHA-256")
  202. message digest of the file.
  203. </dd><dt>'''sha256digest'''</dt><dd>
  204. A synonym for
  205. '''sha256'''.
  206. </dd><dt>'''sha384'''</dt><dd>
  207. The
  208. '''FIPS'''
  209. 180-2
  210. ("Tn SHA-384")
  211. message digest of the file.
  212. </dd><dt>'''sha384digest'''</dt><dd>
  213. A synonym for
  214. '''sha384'''.
  215. </dd><dt>'''sha512'''</dt><dd>
  216. The
  217. '''FIPS'''
  218. 180-2
  219. ("Tn SHA-512")
  220. message digest of the file.
  221. </dd><dt>'''sha512digest'''</dt><dd>
  222. A synonym for
  223. '''sha512'''.
  224. </dd><dt>'''size'''</dt><dd>
  225. The size, in bytes, of the file.
  226. </dd><dt>'''time'''</dt><dd>
  227. The last modification time of the file.
  228. </dd><dt>'''type'''</dt><dd>
  229. The type of the file; may be set to any one of the following:
  230. <dl>
  231. <dt>'''block'''</dt><dd>
  232. block special device
  233. </dd><dt>'''char'''</dt><dd>
  234. character special device
  235. </dd><dt>'''dir'''</dt><dd>
  236. directory
  237. </dd><dt>'''fifo'''</dt><dd>
  238. fifo
  239. </dd><dt>'''file'''</dt><dd>
  240. regular file
  241. </dd><dt>'''link'''</dt><dd>
  242. symbolic link
  243. </dd><dt>'''socket'''</dt><dd>
  244. socket
  245. </dd></dl>
  246. </dd><dt>'''uid'''</dt><dd>
  247. The file owner as a numeric value.
  248. </dd><dt>'''uname'''</dt><dd>
  249. The file owner as a symbolic name.
  250. </dd></dl>
  251. == SEE ALSO ==
  252. [[cksum(1)|http://www.freebsd.org/cgi/man.cgi?query=cksum&sektion=1]],
  253. [[find(1)|http://www.freebsd.org/cgi/man.cgi?query=find&sektion=1]],
  254. [[mtree(8)|http://www.freebsd.org/cgi/man.cgi?query=mtree&sektion=8]]
  255. == HISTORY ==
  256. The
  257. '''mtree'''
  258. utility appeared in
  259. BSD 4.3 Reno.
  260. The
  261. '''MD5'''
  262. digest capability was added in
  263. FreeBSD 2.1,
  264. in response to the widespread use of programs which can spoof
  265. [[cksum(1)|http://www.freebsd.org/cgi/man.cgi?query=cksum&sektion=1]].
  266. The
  267. '''SHA-1'''
  268. and
  269. '''RIPEMD160'''
  270. digests were added in
  271. FreeBSD 4.0,
  272. as new attacks have demonstrated weaknesses in
  273. '''MD5 .'''
  274. The
  275. '''SHA-256'''
  276. digest was added in
  277. FreeBSD 6.0.
  278. Support for file flags was added in
  279. FreeBSD 4.0,
  280. and mostly comes from
  281. NetBSD.
  282. The
  283. "full"
  284. entry format was added by
  285. NetBSD.