.\" As its sole author, I explicitly place this file in the public domain. .\" It may be used by anyone in any way for any purpose, though I would .\" appreciate credit where it's due. .\" der Mouse, mouse@rodents-montreal.org,. 2023-02-14 .Dd Feburary 14, 2023 .Dt TREESUMS 1 .Os NetBSD 1.4T .Sh NAME .Nm treesums .Nd checksum directory trees .Sh SYNOPSIS .Nm .Op options .Op Ar DIR .Sh DESCRIPTION .Nm computes and prints checksums for the contents of a directory tree. .Pp A directory name must be specified, either with no flag .Pf ( Ar DIR above) or with .Fl tree . .Nm checksums everything under that directory. For each filesystem object, the output records its type, its permission bits, and further data depending on its type. Plain files have a checksum printed and symbolic links have the link-to string printed. (The checksum for plain files is, effectively, a concatenation of MD5 and SHA-1 checksums over the content.) Timestamps are specifically not included. Directories are reported in their own right, as well as their contained objects getting lines of their own. .Pp Supported options: .Bl -tag -width indent .It Fl tree Ar DIR The same as specifying .Ar DIR unadorned on the commend line, except it's unambiguous if .Ar dir begins, or might begin, with a dash. .It Fl modemask-dir Ar MODE The permission bits of directories are ANDed with .Ar MODE before printing. .It Fl modemask-reg Ar MODE The permission bits of regular files are ANDed with .Ar MODE before printing. .It Fl modemask-lnk Ar MODE The permission bits of symbolic links are ANDed with .Ar MODE before printing. .It Fl modemask Ar MODE Equivalent to specifying .Fl modemask-dir , .Fl modemask-reg , and .Fl modemask-lnk , all with the same .Ar MODE . .It Fl cores Ar N Attempt to parallelize checksumming, using up to .Ar N worker processes. (As the name implies, this is intended to take advantage of multicore hardware.) .It Fl h .It Fl follow Follow symbolic links, when possible. A symbolic link that points to something accessible will be reported as the thing it points to; if it does not point to anything, or in some cases if the thing it points to is inaccessible, it will still be reported as a symbolic link (this just corresponds to the difference between .Xr stat 2 and .Xr lstat 2 ) . .It Fl xdev Do not cross mount points. If an object is found whose .Dv st_dev differs from that of the main directory, it will be reported with type character .Sq x and will never be descended into, even if it's a directory. .El .Sh BUGS Objects other than directoryes, plain files, and symbolic links should be handled better. (At present, they are printed with what would normally be the type character replaced by a question mark followed by the relevant st_mode field, with the permission bits forced to zero.) .Sh AUTHOR der Mouse, .Aq mouse@rodents-montreal.org .