mtree.5 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. .TH MTREE 5 "September 4, 2013" ""
  2. .SH NAME
  3. .ad l
  4. \fB\%mtree\fP
  5. \- format of mtree dir hierarchy files
  6. .SH DESCRIPTION
  7. .ad l
  8. The
  9. \fB\%mtree\fP
  10. format is a textual format that describes a collection of filesystem objects.
  11. Such files are typically used to create or verify directory hierarchies.
  12. .SS General Format
  13. An
  14. \fB\%mtree\fP
  15. file consists of a series of lines, each providing information
  16. about a single filesystem object.
  17. Leading whitespace is always ignored.
  18. .PP
  19. When encoding file or pathnames, any backslash character or
  20. character outside of the 95 printable ASCII characters must be
  21. encoded as a backslash followed by three
  22. octal digits.
  23. When reading mtree files, any appearance of a backslash
  24. followed by three octal digits should be converted into the
  25. corresponding character.
  26. .PP
  27. Each line is interpreted independently as one of the following types:
  28. .RS 5
  29. .TP
  30. Blank
  31. Blank lines are ignored.
  32. .TP
  33. Comment
  34. Lines beginning with
  35. \fB#\fP
  36. are ignored.
  37. .TP
  38. Special
  39. Lines beginning with
  40. \fB/\fP
  41. are special commands that influence
  42. the interpretation of later lines.
  43. .TP
  44. Relative
  45. If the first whitespace-delimited word has no
  46. \fB/\fP
  47. characters,
  48. it is the name of a file in the current directory.
  49. Any relative entry that describes a directory changes the
  50. current directory.
  51. .TP
  52. dot-dot
  53. As a special case, a relative entry with the filename
  54. \fI\& ..\fP
  55. changes the current directory to the parent directory.
  56. Options on dot-dot entries are always ignored.
  57. .TP
  58. Full
  59. If the first whitespace-delimited word has a
  60. \fB/\fP
  61. character after
  62. the first character, it is the pathname of a file relative to the
  63. starting directory.
  64. There can be multiple full entries describing the same file.
  65. .RE
  66. .PP
  67. Some tools that process
  68. \fB\%mtree\fP
  69. files may require that multiple lines describing the same file
  70. occur consecutively.
  71. It is not permitted for the same file to be mentioned using
  72. both a relative and a full file specification.
  73. .SS Special commands
  74. Two special commands are currently defined:
  75. .RS 5
  76. .TP
  77. \fB/set\fP
  78. This command defines default values for one or more keywords.
  79. It is followed on the same line by one or more whitespace-separated
  80. keyword definitions.
  81. These definitions apply to all following files that do not specify
  82. a value for that keyword.
  83. .TP
  84. \fB/unset\fP
  85. This command removes any default value set by a previous
  86. \fB/set\fP
  87. command.
  88. It is followed on the same line by one or more keywords
  89. separated by whitespace.
  90. .RE
  91. .SS Keywords
  92. After the filename, a full or relative entry consists of zero
  93. or more whitespace-separated keyword definitions.
  94. Each such definition consists of a key from the following
  95. list immediately followed by an '=' sign
  96. and a value.
  97. Software programs reading mtree files should warn about
  98. unrecognized keywords.
  99. .PP
  100. Currently supported keywords are as follows:
  101. .RS 5
  102. .TP
  103. \fBcksum\fP
  104. The checksum of the file using the default algorithm specified by
  105. the
  106. \fBcksum\fP(1)
  107. utility.
  108. .TP
  109. \fBdevice\fP
  110. The device number for
  111. .B block
  112. or
  113. .B char
  114. file types.
  115. The value must be one of the following forms:
  116. .RS 5
  117. .TP
  118. \fIformat\fP, \fImajor\fP, \fIminor\fP Bo, \fIsubunit\fP Bc
  119. A device with
  120. \fImajor\fP, minor
  121. and optional
  122. \fIsubunit\fP
  123. fields.
  124. Their meaning is specified by the operating's system
  125. \fIformat\fP.
  126. See below for valid formats.
  127. .TP
  128. \fInumber\fP
  129. Opaque number (as stored on the file system).
  130. .RE
  131. .PP
  132. The following values for
  133. \fIformat\fP
  134. are recognized:
  135. .B native ,
  136. .B 386bsd ,
  137. .B 4bsd ,
  138. .B bsdos ,
  139. .B freebsd ,
  140. .B hpux ,
  141. .B isc ,
  142. .B linux ,
  143. .B netbsd ,
  144. .B osf1 ,
  145. .B sco ,
  146. .B solaris ,
  147. .B sunos ,
  148. .B svr3 ,
  149. .B svr4 ,
  150. and
  151. .B ultrix .
  152. .PP
  153. See
  154. \fBmknod\fP(8)
  155. for more details.
  156. .TP
  157. \fBcontents\fP
  158. The full pathname of a file that holds the contents of this file.
  159. .TP
  160. \fBflags\fP
  161. The file flags as a symbolic name.
  162. See
  163. \fBchflags\fP(1)
  164. for information on these names.
  165. If no flags are to be set the string
  166. ``none''
  167. may be used to override the current default.
  168. .TP
  169. \fBgid\fP
  170. The file group as a numeric value.
  171. .TP
  172. \fBgname\fP
  173. The file group as a symbolic name.
  174. .TP
  175. \fBignore\fP
  176. Ignore any file hierarchy below this file.
  177. .TP
  178. \fBinode\fP
  179. The inode number.
  180. .TP
  181. \fBlink\fP
  182. The target of the symbolic link when type=link.
  183. .TP
  184. \fBmd5\fP
  185. The MD5 message digest of the file.
  186. .TP
  187. \fBmd5digest\fP
  188. A synonym for
  189. \fBmd5\fP.
  190. .TP
  191. \fBmode\fP
  192. The current file's permissions as a numeric (octal) or symbolic
  193. value.
  194. .TP
  195. \fBnlink\fP
  196. The number of hard links the file is expected to have.
  197. .TP
  198. \fBnochange\fP
  199. Make sure this file or directory exists but otherwise ignore all attributes.
  200. .TP
  201. \fBoptional\fP
  202. The file is optional; do not complain about the file if it is not in
  203. the file hierarchy.
  204. .TP
  205. \fBresdevice\fP
  206. The
  207. ``resident''
  208. device number of the file, e.g. the ID of the device that
  209. contains the file.
  210. Its format is the same as the one for
  211. \fBdevice\fP.
  212. .TP
  213. \fBripemd160digest\fP
  214. The
  215. Tn RIPEMD160
  216. message digest of the file.
  217. .TP
  218. \fBrmd160\fP
  219. A synonym for
  220. \fBripemd160digest\fP.
  221. .TP
  222. \fBrmd160digest\fP
  223. A synonym for
  224. \fBripemd160digest\fP.
  225. .TP
  226. \fBsha1\fP
  227. The
  228. Tn FIPS
  229. 160-1
  230. (``Tn SHA-1'')
  231. message digest of the file.
  232. .TP
  233. \fBsha1digest\fP
  234. A synonym for
  235. \fBsha1\fP.
  236. .TP
  237. \fBsha256\fP
  238. The
  239. Tn FIPS
  240. 180-2
  241. (``Tn SHA-256'')
  242. message digest of the file.
  243. .TP
  244. \fBsha256digest\fP
  245. A synonym for
  246. \fBsha256\fP.
  247. .TP
  248. \fBsha384\fP
  249. The
  250. Tn FIPS
  251. 180-2
  252. (``Tn SHA-384'')
  253. message digest of the file.
  254. .TP
  255. \fBsha384digest\fP
  256. A synonym for
  257. \fBsha384\fP.
  258. .TP
  259. \fBsha512\fP
  260. The
  261. Tn FIPS
  262. 180-2
  263. (``Tn SHA-512'')
  264. message digest of the file.
  265. .TP
  266. \fBsha512digest\fP
  267. A synonym for
  268. \fBsha512\fP.
  269. .TP
  270. \fBsize\fP
  271. The size, in bytes, of the file.
  272. .TP
  273. \fBtime\fP
  274. The last modification time of the file.
  275. .TP
  276. \fBtype\fP
  277. The type of the file; may be set to any one of the following:
  278. .PP
  279. .RS 5
  280. .TP
  281. \fBblock\fP
  282. block special device
  283. .TP
  284. \fBchar\fP
  285. character special device
  286. .TP
  287. \fBdir\fP
  288. directory
  289. .TP
  290. \fBfifo\fP
  291. fifo
  292. .TP
  293. \fBfile\fP
  294. regular file
  295. .TP
  296. \fBlink\fP
  297. symbolic link
  298. .TP
  299. \fBsocket\fP
  300. socket
  301. .RE
  302. .TP
  303. \fBuid\fP
  304. The file owner as a numeric value.
  305. .TP
  306. \fBuname\fP
  307. The file owner as a symbolic name.
  308. .RE
  309. .SH SEE ALSO
  310. .ad l
  311. \fBcksum\fP(1),
  312. \fBfind\fP(1),
  313. \fBmtree\fP(8)
  314. .SH HISTORY
  315. .ad l
  316. The
  317. \fB\%mtree\fP
  318. utility appeared in
  319. Bx 4.3 Reno.
  320. The
  321. Tn MD5
  322. digest capability was added in
  323. FreeBSD 2.1,
  324. in response to the widespread use of programs which can spoof
  325. \fBcksum\fP(1).
  326. The
  327. Tn SHA-1
  328. and
  329. Tn RIPEMD160
  330. digests were added in
  331. FreeBSD 4.0,
  332. as new attacks have demonstrated weaknesses in
  333. Tn MD5.
  334. The
  335. Tn SHA-256
  336. digest was added in
  337. FreeBSD 6.0.
  338. Support for file flags was added in
  339. FreeBSD 4.0,
  340. and mostly comes from
  341. NetBSD.
  342. The
  343. ``full''
  344. entry format was added by
  345. NetBSD.