MTREE(5)
π MTREE(5) β the manual page, but make it a group chat π
okay bestie, listen. this is mtree, and this page is the format of mtree dir hierarchy files. it's in the File Formats Manual section, so we're talking about a file format, not a command β the command lives over in mtree(8) and we'll get there. π
β¨ NAME β¨
mtree β format of mtree dir hierarchy files ποΈβ¨
πΈ DESCRIPTION πΈ
so basically, the mtree format is a textual format that describes a collection of filesystem objects. that's the whole vibe. these files are typically used to create or verify directory hierarchies β like, you write down what your tree should look like, and then a tool goes and checks it. it's giving inventory spreadsheet but make it iconic. π
π¦ General Format π¦
An mtree file consists of a series of lines, each providing information about a single filesystem object. Leading whitespace is always ignored β so go ahead and indent, nobody's judging. π
When encoding file or pathnames, any backslash character or character outside of the 95 printable ASCII characters must be encoded as a backslash followed by three octal digits. When reading mtree files, any appearance of a backslash followed by three octal digits should be converted into the corresponding character. so it's a little escape-code moment, iykyk. π₯
Each line is interpreted independently as one of the following types:
- Blank β Blank lines are ignored. literally nothing, no notes. π
- Comment β Lines beginning with
#are ignored. say what you need to say, bestie. - Special β Lines beginning with
/are special commands that influence the interpretation of later lines. these are the ones that change the rules mid-game π - Relative β If the first whitespace-delimited word has no
/characters, it is the name of a file in the current directory. Any relative entry that describes a directory changes the current directory. so you're walking the tree, not just reading it. πΆββοΈ - dot-dot β As a special case, a relative entry with the filename
..changes the current directory to the parent directory. Options on dot-dot entries are always ignored β sorry to the options, this is not your moment. π - Full β If the first whitespace-delimited word has a
/character after the first character, it is the pathname of a file relative to the starting directory. There can be multiple full entries describing the same file.
Some tools that process mtree files may require that multiple lines describing the same file occur consecutively. And it is not permitted for the same file to be mentioned using both a relative and a full file specification. pick a lane, babe. π«
π§ Special commands π§
Two special commands are currently defined:
/setβ This command defines default values for one or more keywords. It is followed on the same line by one or more whitespace-separated keyword definitions. These definitions apply to all following files that do not specify a value for that keyword. it's the "set the tone for everyone after you" move. π/unsetβ This command removes any default value set by a previous/setcommand. It is followed on the same line by one or more keywords separated by whitespace. the undoing. the reversal. π
π Keywords π
After the filename, a full or relative entry consists of zero or more whitespace-separated keyword definitions. Each such definition consists of a key from the following list immediately followed by an = sign and a value. Software programs reading mtree files should warn about unrecognized keywords β so if you make one up, expect to be read for filth. π
Currently supported keywords are as follows:
cksumβ The checksum of the file using the default algorithm specified by thecksum(1)utility. β¨deviceβ The device number for block or char file types. The value must be one of the following forms:format,major,minor[,subunit]β A device with major, minor and optional subunit fields. Their meaning is specified by the operating system's format. See below for valid formats.numberβ Opaque number (as stored on the file system).
The following values for format are recognized: native, 386bsd, 4bsd, bsdos, freebsd, hpux, isc, linux, netbsd, osf1, sco, solaris, sunos, svr3, svr4, and ultrix.
See mknod(8) for more details.
contentsβ The full pathname of a file that holds the contents of this file. πflagsβ The file flags as a symbolic name. Seechflags(1)for information on these names. If no flags are to be set the stringnonemay be used to override the current default.gidβ The file group as a numeric value. π’gnameβ The file group as a symbolic name.ignoreβ Ignore any file hierarchy below this file. we do not see it. it does not exist. π«£inodeβ The inode number.linkβ The target of the symbolic link whentype=link. πmd5β The MD5 message digest of the file.md5digestβ A synonym formd5.modeβ The current file's permissions as a numeric (octal) or symbolic value. the chmod energy β¨nlinkβ The number of hard links the file is expected to have.nochangeβ Make sure this file or directory exists but otherwise ignore all attributes. "you just need to BE here, bestie." πoptionalβ The file is optional; do not complain about the file if it is not in the file hierarchy. no nagging, no notes. πresdeviceβ The "resident" device number of the file, e.g. the ID of the device that contains the file. Its format is the same as the one fordevice.ripemd160digestβ The RIPEMD160 message digest of the file.rmd160β A synonym forripemd160digest.rmd160digestβ A synonym forripemd160digest.sha1β The FIPS 160-1 ("SHA-1") message digest of the file.sha1digestβ A synonym forsha1.sha256β The FIPS 180-2 ("SHA-256") message digest of the file.sha256digestβ A synonym forsha256.sha384β The FIPS 180-2 ("SHA-384") message digest of the file.sha384digestβ A synonym forsha384.sha512β The FIPS 180-2 ("SHA-512") message digest of the file.sha512digestβ A synonym forsha512.sizeβ The size, in bytes, of the file.timeβ The last modification time of the file. β°typeβ The type of the file; may be set to any one of the following:blockβ block special devicecharβ character special devicedirβ directoryfifoβ fifofileβ regular filelinkβ symbolic linksocketβ socket
uidβ The file owner as a numeric value.unameβ The file owner as a symbolic name.
π SEE ALSO π
π HISTORY π
The mtree utility appeared in 4.3BSD-Reno. The MD5 digest capability was added in FreeBSD 2.1, in response to the widespread use of programs which can spoof cksum(1). The SHA-1 and RIPEMD160 digests were added in FreeBSD 4.0, as new attacks have demonstrated weaknesses in MD5. The SHA-256 digest was added in FreeBSD 6.0. Support for file flags was added in FreeBSD 4.0, and mostly comes from NetBSD. The "full" entry format was added by NetBSD. history class but make it tea βπ
and that's the whole page, bestie!! this one came from the Debian build, dated September 4, 2013 β so if you're citing it, that's your source and date, periodt. π«Άβ¨
π¦ where this page comes from
- alpine 3.22: libarchive-doc 3.8.10-r0 Β· BSD-2-Clause AND BSD-3-Clause AND Public-Domain
- alpine 3.22: libarchive-doc 3.8.11-r0 Β· BSD-2-Clause AND BSD-3-Clause AND Public-Domain
- alpine 3.23: libarchive-doc 3.8.10-r0 Β· BSD-2-Clause AND BSD-3-Clause AND Public-Domain
- alpine 3.23: libarchive-doc 3.8.11-r0 Β· BSD-2-Clause AND BSD-3-Clause AND Public-Domain
- alpine 3.24: libarchive-doc 3.8.10-r0 Β· BSD-2-Clause AND BSD-3-Clause AND Public-Domain
- alpine 3.24: libarchive-doc 3.8.11-r0 Β· BSD-2-Clause AND BSD-3-Clause AND Public-Domain
- arch rolling: libarchive 3.8.10-1
- arch rolling: libarchive 3.8.11-1 Β· BSD-2-Clause AND BSD-4-Clause-UC AND Apache-2.0 OR CC0-1.0 OR OpenSSL
- Copyright (c) 1989, 1990, 1993 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms