.\" tdiff - tree diffs .\" tdiff.1 - Manual page .\" Copyright (C) 2019, 2024 Philippe Troin .\" .\" This program is free software; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by .\" the Free Software Foundation; either version 3 of the License, or .\" (at your option) any later version. .\" .\" This program is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public License .\" along with this program. If not, see . .TH TDIFF 1 "January 2024" "tdiff 0.8.7" "User Commands" .SH NAME tdiff \- tree diff, list differences between various inode attributes ( .BR stat(2) structure) and contents for two directory trees .SH SYNOPSIS .B tdiff [\fI\,OPTIONS\/\fR]... \fIDIRECTORY1\fR \fIDIRECTORY2\fR .SH DESCRIPTION .PP List differences between .I DIRECTORY1 and .I DIRECTORY2 file trees, comparing any of the inode attributes, also known as .BR stat(2) structure members. Inode attributes are: .RS 3 .IP \(bu 3 file type (regular file, directory, FIFO, socket, etc.), .IP \(bu file size, .IP \(bu file block count (physical storage size), .IP \(bu owner uid and gid, .IP \(bu access, modification and inode change times, .IP \(bu the set of hard links a file has, .IP \(bu extended attributes (if supported), .IP \(bu ACLs (if supported), .IP \(bu file system flags (BSD UFS, MacOSX). .RS -3 .PP By default, .B tdiff reports differences in any file contents or attributes except for the various file times. The set of attributes to be checked can be modified with the various options. .PP Beyond inode attribute checks, .B tdiff can check (and will check by default) regular files for contents difference. Optionally, .B tdiff can use an external program to determine if the files are considered to be different. See the \fB\-x\fR/\fB\-\-exec\fR, \fB\-w\fR/\fB\-\-exec\-always\fR, and \fB\-W\fR/\fB\-\-exec\-always\-diff\fR options. .SH OPTIONS .SS Standard Options .TP \fB\-h\fR, \fB\-\-help\fR Show a short \fBh\fRelp message and exit. .TP \fB\-v\fR, \fB\-\-verbose\fR Increase \fBv\fRerbosity. Four cumulative levels of logging verbosity are supported: .RS 10 .TP .B -v report overall statistics: total number of files scanned, compared, etc. .TP .B -vv report if any files are skipped, and for what reason (exclusion, already compared, etc.) .TP .B -vvv report internal data structure statistics. .TP .B -vvvv report memory statistics (if available on your system). .RS -10 .TP \fB\-V\fR, \fB\-\-version\fR Show the .B tdiff \fBv\fRersion information, compiled-in features and flags (if any) then exit. .br The compiled-in feature list shows which features .B tdiff has been compiled with: O_NOATIME, flags, acl, and xattr support, acl optimization (\fBacl_cmp\fR), the .BR readdir(2) implementation used, the file system time granularity (either seconds (\fI\,s\/\fR) or nanoseconds (\fI\,ns\/\fR)) and if comparing symbolic links will update their access time (\fBreadlink=readlink\fR) or not (\fBreadlink=open(O_PATH|O_NOFOLLOW)+readlinkat\fR). .br If flags support is compiled in, the list of recognized flags will be listed as well. .SS Toggle Options The single-letter toggle options come in two versions, upper-case and lower-case. The lower-case option enables the the attribute check, while the upper-case option disables it. .PP The long toggle options are named after the .BR stat(2) structure names: for example, .B \-\-mtime is used to check the .I st_mtime .BR stat(2) structure member, which is the file modification time. Similarly to short toggle options, long toggle options have a \fB\-\-no\-\fR version to turn off the equivalent check (eg. \fB\-\-no\-mtime\fR). .TP \fB\-b\fR, \fB\-\-blocks\fR Report file \fBb\fRlock count differences (\fI\,st_blocks\/\fR) except for directories which are ignored. .br This is on by default. .TP \fB\-B\fR, \fB\-\-no\-blocks\fR Do not report file \fBb\fRlock count differences. .TP \fB\-c\fR, \fB\-\-contents\fR Report file \fBc\fRontent differences for regular files and symbolic links. .br For regular files, their contents are compared and any discrepancies are reported as a contents difference. .br For symbolic links, a difference will be reported if their targets differ. .br See the .B CONTENTS COMPARISONS section below for the exact semantics. .br This is on by default. .TP \fB\-C\fR, \fB\-\-no\-contents\fR Do not report file \fBc\fRontent differences. .TP \fB\-d\fR, \fB\-\-dirs\fR Diff \fBd\fRirectory contents: report if any file is present in only one directory. .br This is on by default. .TP \fB\-D\fR, \fB\-\-no\-dirs\fR Do not diff \fBd\fRirectory contents: files only present in a single directory are not reported. .TP \fB\-e\fR, \fB\-\-hardlinks\fR Report any differences in the set of hard links a file may be linked to. .br For example if in a directory two files are hard linked together while in the other directory, they are not, .B tdiff will report that the files are hard links only in the first directory. .br .B tdiff will only report the differences once per set of hard links: if in a directory \fBf1\fR, \fBf2\fR and \fBf3\fR are hard links while in the other \fBf1\fR and \fBf2\fR are hard links while \fBf3\fR exists but is not a hard link, .B tdiff will report that \fBf1\fR is only linked to \fBf3\fR in the first directory but will not report the same information for \fBf2\fR because \fBf1\fR and \fBf2\fR are part of the same set of hard linked files. .br This is on by default. .TP \fB\-E\fR, \fB\-\-no\-hardlinks\fR Will not report any differences in hard links sets. .TP \fB\-f\fR, \fB\-\-flags\fR Diff file system \fBf\fRlags, as found in the .BR stat(2) .I st_flags structure member. This is only supported on BSD, MacOSX and other systems that have \fIst_flags\/\fR. .br .B tdiff --version will list which file system flags .B tdiff has been compiled with, but .B tdiff will report even differences in other flags unknown at compilation time, but will do so numerically instead of listing the actual flag name. .br This is on by default if your system's .BR stat(2) structure has \fIst_flags\fR. .TP \fB\-F\fR, \fB\-\-no\-flags\fR Do not diff file system \fBf\fRlags. .TP \fB\-g\fR, \fB\-\-gid\fR Report on any differences in file \fBg\fRroup ownership (owner group id, \fIst_gid\/\fR). .br This is on by default. .TP \fB\-G\fR, \fB\-\-no\-gid\fR Do not report any differences in file \fBg\fRroup ownership (owner group id). .TP \fB\-i\fR, \fB\-\-mtime\fR Report on any differences in file modification t\fBi\fRme (\fI\,st_mtime\/\fR), up to nanosecond resolution if the underlying OS reports it. .TP \fB\-I\fR, \fB\-\-no\-mtime\fR Do not report any differences in file modification t\fBi\fRmes (\fI\,st_mtime\/\fR). .br This is on by default. .TP \fB\-j\fR, \fB\-\-major\fR For device files (either block or character), report any differences in ma\fBj\fRor device numbers. .br Note that major numbers will only be compared if both device files are of the same type (block or character). .br This is on by default. .TP \fB\-J\fR, \fB\-\-no\-major\fR Do not report any differences in ma\fBj\fRor device numbers on device files. .TP \fB\-k\fR, \fB\-\-minor\fR For device files (either block or character), report any differences in minor device numbers. .br Note that minor numbers will only be compared if both device files are of the same type (block or character). .br This is on by default. .TP \fB\-K\fR, \fB\-\-no\-minor\fR Do not report any differences in minor device numbers on device files. .TP \fB\-l\fR, \fB\-\-acl\fR Report on any differences in file AC\fBL\fRs as defined by .BR acl_set_file(3) . .br Any missing or different ACLs between the file pairs are reported. Access, default and mask ACL entries are supported. .br This is on by default if ACLs are supported by the system. .TP \fB\-L\fR, \fB\-\-no\-acl\fR Do not report any differences in file AC\fBL\fRs. .TP \fB\-m\fR, \fB\-\-mode\fR Report on any differences in file access \fBm\fRode (permission bits as set by .BR chmod(1) ). If set, \fB\-o\fR/\fB\-\-mode\-or\fR and \fB\-a\fR/\fB\-\-mode\-and\fR bitmasks are applied, if set. .br This is on by default. .TP \fB\-M\fR, \fB\-\-no\-mode\fR Do not report any differences in file access \fBm\fRodes (permission bits). .TP \fB\-n\fR, \fB\-\-nlink\fR Report on any differences in file (hard) link counts (\fI\,st_\/\fBn\fI\,links\/\fR). .br This is on by default. .TP \fB\-N\fR, \fB\-\-no\-nlink\fR Do not report any differences in file (hard) link counts. .TP \fB\-q\fR, \fB\-\-xattr\fR Report on any differences in file extended attributes as defined by .BR setxattr(2) . .br Any missing or different extended attribute between the file pairs is reported. .br This is on by default if extended attributes are supported by the system. .TP \fB\-Q\fR, \fB\-\-no\-xattr\fR Do not report any differences in file extended attributes. .TP \fB\-s\fR, \fB\-\-size\fR Report file \fBs\fRize differences (\fI\,st_size\/\fR), except for directories which are ignored. .br This is on by default. .TP \fB\-S\fR, \fB\-\-no\-size\fR Do not report file \fBs\fRize differences. .TP \fB\-t\fR, \fB\-\-type\fR Report file \fBt\fRype differences (files, directories, symbolic links, etc.) .br This is on by default. .TP \fB\-T\fR, \fB\-\-no\-type\fR Do not report file \fBt\fRype differences between the two compared directories. .TP \fB\-u\fR, \fB\-\-uid\fR Report on any differences in file \fBu\fRser ownership (owner user id, \fIst_uid\/\fR). .br This is on by default. .TP \fB\-U\fR, \fB\-\-no\-uid\fR Do not report any differences in file \fBu\fRser ownership (owner user id). .TP \fB\-y\fR, \fB\-\-atime\fR Report on any differences in file access time (\fI\,st_atime\/\fR), up to nanosecond resolution if the underlying OS reports it. .br Since merely reading a file causes the access time to be updated, this option is likely to be of limited use. .B tdiff will not update the file access times when comparing files if compiled on an OS with .B O_NOATIME .BR open(2) support, whenever possible. One of the Operating Systems with .B O_NOATIME support, Linux, only allows to open a file with .B O_NOATIME if .B tdiff is ran by the file owner or root. All files for which this is the case will then be opened with \fBNO_ATIME\fR, but .B tdiff will silently drop the .B O_NOATIME flag if a .I Permission denied error is encountered. Please also note that commands specified with \fB\-x\fR/\fB\-\-exec\fR, \fB\-w\fR/\fB\-\-exec\-always\fR or \fB\-W\fR/\fB\-\-exec\-always\-diff\fR may update the access times of the files they read. .TP \fB\-Y\fR, \fB\-\-no\-atime\fR Do not report any differences in file access times (\fI\,st_atime\/\fR). .br This is on by default. .TP \fB\-z\fR, \fB\-\-ctime\fR Report on any differences in file inode change time (\fI\,st_ctime\/\fR), up to nanosecond resolution if the underlying OS reports it. .br Since inode change times are automatically set by Unix to the current time and cannot be changed afterwards, they will always be reported as different for any two file trees, except in rare cases (likely involving cloning raw file system images). .TP \fB\-Z\fR, \fB\-\-no\-ctime\fR Do not report any differences in file file inode change times (\fI\,st_ctime\/\fR). .br This is on by default. .SS Preset Options The preset single letter options are either a numeric preset level from \fI0\fR to \fI9\/\fR, or .B \-p followed by a preset name or level. Presets can also be activated with the .B \-\-preset long option followed by either a numeric preset level or a preset name. .br Preset names can be shortened to their smallest unambiguous prefix. For example, \fB\-\-preset\fR \fIamtimes\/\fR can be shortened to \fIam\/\fR, \fImissing\fR to \fImiss\/\fR, \fIdefault\fR to \fId\/\fR, etc. .PP The presets are cumulative, preset level \fI9\fR is a super-set of preset level \fI8\/\fR, itself a super-set of level \fI7\fR and so on. .PP The default preset level when .B tdiff starts parsing its options is preset \fI6\/\fR/\fI\,notimes\/\fR/\fI\,default\/\fR. .TP \fB\-0\fR, \fB\-p\fR|\fB\-\-preset\fR \fI0\/\fR|\fI\,none\fR Do not check anything. All the toggles are set to their inactive (\fB\-\-no\-\fR) state. .br If only this preset is active (it is provided last on the command line for example), .B tdiff will not report anything but will still traverse the file trees. This is only useful to reset \fBtdiff\fR's set of comparisons to the empty set and add exactly which fields should be compared with further toggle options. .TP \fB\-1\fR, \fB\-p\fR|\fB\-\-preset\fR \fI1\/\fR|\fI\,missing\/\fR|\fI\,type\fR Report missing files and different file types. .br .B tdiff will only emit messages for either files missing in either directory (\fB\-d\fR/\fB\-\-dirs\fR) or if they are of different file types (\fB\-t\fR/\fB\-\-type\fR). All the other toggles are set to their inactive (\fB\-\-no\-\fR) state. .TP \fB\-2\fR, \fB\-p\fR|\fB\-\-preset\fR \fI2\/\fR|\fI\,mode\fR In addition to the comparisons enabled at preset level \fI1\/\fR, .B tdiff will also enable file mode comparisons (\fB\-m\fR/\fB\-\-mode\fR). All the other toggles are set to their inactive (\fB\-\-no\-\fR) state. .TP \fB\-3\fR, \fB\-p\fR|\fB\-\-preset\fR \fI3\/\fR|\fI\,owner\fR In addition to the comparisons enabled at preset level \fI2\/\fR, .B tdiff will also enable user id (\fB\-u\fR/\fB\-\-uid\fR), group id (\fB\-g\fR/\fB\-\-gid\fR) and, if supported, Access Control Lists (\fB\-l\fR/\fB\-\-acl\fR) comparisons. All the other toggles are set to their inactive (\fB\-\-no\-\fR) state. .TP \fB\-4\fR, \fB\-p\fR|\fB\-\-preset\fR \fI4\/\fR|\fI\,hardlinks\fR In addition to the comparisons enabled at preset level \fI3\/\fR, .B tdiff will also enable link count (\fB\-n\fR/\fB\-\-nlink\fR) and hard link targets (\fB\-e\fR/\fB\-\-hardlinks\fR) comparisons. All the other toggles are set to their inactive (\fB\-\-no\-\fR) state. .TP \fB\-5\fR, \fB\-p\fR|\fB\-\-preset\fR \fI5\/\fR|\fI\,contents\fR In addition to the comparisons enabled at preset level \fI4\/\fR, .B tdiff will also compare file contents (\fB\-c\fR/\fB\-\-contents\fR), size (\fB\-s\fR/\fB\-\-size\fR), block usage (\fB\-b\fR/\fB\-\-blocks\fR), and for device files, major (\fB\-j\fR/\fB\-\-major\fR) and minor (\fB\-k\fR/\fB\-\-minor\fR) device numbers. All the other toggles are set to their inactive (\fB\-\-no\-\fR) state. .TP \fB\-6\fR, \fB\-p\fR|\fB\-\-preset\fR \fI6\/\fR|\fI\,notimes\/\fR|\fI\,default\fR In addition to the comparisons enabled at preset level \fI5\/\fR, .B tdiff will also compare, if supported, flags (\fB\-f\fR/\fB\-\-flags\fR) and extended attributes (\fB\-q\fR/\fB\-\-xattr\fR). All the other toggles are set to their inactive (\fB\-\-no\-\fR) state. This corresponds to a state where all toggles are on except the three times (\fB\-y\fR/\fB\-\-atime\fR, \fB\-i\fR/\fB\-\-mtime\fR and \fB\-z\fR/\fB\-\-ctime\fR) that are off. .br If your system does not support either flags or extended attributes, then preset level \fI6\fR is equivalent to preset level \fI5\/\fR. .br This is the default preset level. .TP \fB\-7\fR, \fB\-p\fR|\fB\-\-preset\fR \fI7\/\fR|\fI\,mtime\fR In addition to the comparisons enabled at preset level \fI6\/\fR, .B tdiff will also compare file modification times (\fB\-i\fR/\fB\-\-mtime\fR). This corresponds to a state where all toggles are on except the file access time (\fB\-y\fR/\fB\-\-atime\fR) and the inode modification time (\fB\-z\fR/\fB\-\-ctime\fR) that are off. .TP \fB\-8\fR, \fB\-p\fR|\fB\-\-preset\fR \fI8\/\fR|\fI\,amtimes\fR In addition to the comparisons enabled at preset level \fI7\/\fR, .B tdiff will also compare file access times (\fB\-y\fR/\fB\-\-atime\fR). This corresponds to a state where all toggles are on except the inode modification time (\fB\-z\fR/\fB\-\-ctime\fR) that is off. .TP \fB\-9\fR, \fB\-p\fR|\fB\-\-preset\fR \fI9\/\fR|\fI\,alltimes\fR|\fI\,all\fR .B tdiff will compare all available attributes, turning all toggles on. .SS Other Miscellaneous Options .TP \fB\-a\fR, \fB\-\-mode\-and\fR \fIMASK\fR When comparing file permission bits, perform a binary \fBa\fRnd between the permission bits and .I MASK before comparing them. .br .I MASK is specified in octal, like with .BR chmod(2) , unless prefixed with \fI0x\/\fR, in which case it is parsed as hexadecimal. .TP \fB\-o\fR, \fB\-\-mode\-or\fR \fIMASK\fR When comparing file permission bits, perform a binary \fBo\fRr between the permission bits and .I MASK before comparing them. .br .I MASK is specified in octal, like with .BR chmod(2) , unless prefixed with \fI0x\/\fR, in which case it is parsed as hexadecimal. .TP \fB\-w\fR, \fB\-\-exec\-always\fR \fICOMMAND... \\\/;\fR Always execute .I COMMAND for any pair of matching regular files found in the trees. Refer to the .B CONTENTS COMPARISONS section for details. .br If either options are specified more than once, the last command defined will be used. .br Using either option turns on the \fB-c\fR/\fB--contents\fR toggle. .TP \fB\-W\fR, \fB\-\-exec\-always\-diff\fR Always execute .I diff \-u for any pair of matching regular files found in the trees. This is a shortcut for: .in +2 .br .B tdiff \-\-exec\-always diff \-u %1 %2 \\\\; .in -2 .br The option will supersede whichever command was specified in a \fB\-w\fR/\fB\-\-exec\-always\fR option appearing earlier on the option list. .br Using either option turns on the \fB-c\fR/\fB--contents\fR toggle. .TP \fB\-x\fR, \fB\-\-exec\fR \fICOMMAND... \\\/;\fR Uses .I COMMAND when comparing files whose sizes are the same. Refer to the .B CONTENTS COMPARISONS section for details. .br If either options are specified more than once, the last command defined will be used. .br Using either option turns on the \fB-c\fR/\fB--contents\fR toggle. .TP \fB\-X\fR, \fB\-\-exclude\fR \fIFILE\fR Excludes .I FILE from processing: any discrepancies on a file or missing file named .I FILE will not be reported. Neither will external commands be ran on them. If .I FILE matches the name of a directory, it will not be descended into and any sub-directories or files it contains will be completely ignored. .br This option may be specified more than once, all the files listed will be added to the exclusion list. .TP \fB\-O\fR, \fB\-\-follow\-symlinks\fR Completely ignore symbolic links and always f\fBO\fRllow and dereference them. .br This is off by default (symbolic links are not followed / dereferenced). .SH HARD LINKS .B tdiff optimizes for hard links in two ways: .RS 3 .IP \(bu 3 .B tdiff will skip examining a pair of files if it has already compared the pair's hard links copies. .RS 3 .PP For example, if you have \fIfile1\fR hard linked to \fIfile2\fR in both \fIDIRECTORY1\fR and \fIDIRECTORY2\/\fR, .B tdiff will only report any differences for \fIfile1\fR and will skip \fIfile2\fR entirely since it's linked to \fIfile1\fR in both examined directories, and the list of differences would the same as for the already reported \fIfile1\fR case. .RS -3 .IP \(bu 3 .B tdiff will skip examining two hard-linked files. .RS 3 .PP For example, if \fIdir1/file\fR is hard linked to \fIdir2/file\/\fR, then .B tdiff will omit examining the file pair entirely since they really are the same object and would have no differences at all. .RS -6 .PP \fBtdiff\fR's hard link optimization depends on files' inode and device numbers to be stable, unique and consistent at least for the duration of the .B tdiff run. This is generally the case for traditional file systems. .PP .B tdiff can optionally show which hard linked files are skipped and for what reason when run at the verbosity level 2 or above (\fB-vv\fR or \fB--verbose --verbose\fR). .SH CONTENTS COMPARISONS .B tdiff uses built-in code for file contents comparisons. It avoid running an actual comparison if the file's sizes (\fI\,st_size\/\fR) are different: the files with different sizes will be reported as having different contents without even comparing them as the size difference is enough to ascertain that their contents differ. .PP Optionally, .B tdiff can run external commands to perform the comparison. When providing an external command, the .I COMMAND must be passed as multiple arguments terminated by a semi-colon, which must be escaped to avoid processing by the shell. .I COMMAND should not be quoted as a single argument. .br In the arguments can appear the strings .I %1 and .I %2 which will be respectively replaced by the paths to files in the first and second compared directories. .I %1 and .I %2 can only appear once on the command line, and must be full words: they cannot appear inside a larger shell word. .br For example: .RS 2 .br .B tdiff --exec gtkdiff %1 %2 \\\\; directory1 directory2 .RS -2 .PP If either the \fB\-x\fR or \fB\-\-exec\fR options are used, the command specified there will be ran instead of the built-in comparison and its exit status used to detect a difference (zero exit status meaning no difference, and non-zero meaning a difference). With either these options in effect, .B tdiff will not print any error message if the files are different, the command used for \fB\-x\fR/\fB\-\-exec\fR should take care of reporting the error. Note that the command .I will not be ran if .B tdiff .I can find via the file size that the files differ by virtue of having different sizes. .PP If either the \fB\-w\fR/\fB\-\-exec\-always\fR or \fB\-W\fR/\fB\-\-exec\-always\-diff\fR options are used, the command specified with these options will always be ran for every pair of regular files having the same path in both directories, whether or not they have the same size. The internal comparison pass will run and will report if the files are different, then the \fB\-w\fR/\fB\-\-exec\-always\fR/\fB\-W\fR/\fB\-\-exec\-always\-diff\fR command will run. .B tdiff will record a difference if the \fB\-w\fR/\fB\-\-exec\-always\fR/\fB\-W\fR/\fB\-\-exec\-always\-diff\fR command returns with non\-zero exit status, even if the internal comparison or the \fB\-x\fR/\fB\-\-exec\fR command are successful. .PP If both \fB\-x\fR/\fB\-\-exec\fR and \fB\-w\fR/\fB\-\-exec\-always\fR/\fB\-W\fR/\fB\-\-exec\-always\-diff\fR options are used, then the command specified for \fB\-x\fR/\fB\-\-exec\fR will be ran if the file sizes of the compared files are the same, and the command specified by \fB\-w\fR/\fB\-\-exec\-always\fR/\fB\-W\fR/\fB\-\-exec\-always\-diff\fR will always run. .br This means that with options from both groups active, both the \fB\-x\fR/\fB\-\-exec\fR and \fB\-w\fR/\fB\-\-exec\-always\fR/\fB\-W\fR/\fB\-\-exec\-always\-diff\fR commands will be ran for files with the same size. .SH EXIT STATUS .B tdiff exits with status: .TP 0 if no discrepancies nor errors were encountered. .TP 1 if there were any problems with arguments or parsing the command line. .TP 2 if there were any differences reported, either by .B tdiff logging a discrepancy, or any of the \fB\-x\fR/\fB\-\-exec\fR or \fB\-w\fR/\fB\-\-exec\-always\fR commands exiting with non-zero status. .TP 3 if there was any system error (a file couldn't be read for example). .TP 4 if there was an internal error. This should not happen. .SH EXAMPLES Check that the two file trees rooted at .I directory1 and .I directory2 are exactly the same, including symbolic link targets if any, permissions, hard disk block usage, owner user and group ids, and if supported, flags, ACLs and extended attributes: .RS 4 .PP .B tdiff .I directory1 directory2 .RS -4 .PP Same as previous example, but also check that the file modification times are the same: .RS 4 .PP .B tdiff -i .I directory1 directory2 .RS -4 .PP Only report if any files are present in only one directory: .RS 4 .PP .B tdiff \-0 \-\-dirs .I directory1 directory2 .RS -4 .PP Report only ownership (user or group id) differences, ignore any missing files: .RS 4 .PP .B tdiff \-0 \-\-uid \-\-gid .I directory1 directory2 .RS -4 .PP Report only group permission bits differences, ignore any missing files: .RS 4 .PP .B tdiff \-0 \-\-mode \-\-mode\-and 70 .I directory1 directory2 .RS -2 .PP or: .RS 2 .PP .B tdiff \-0 \-\-mode \-\-mode\-or 7707 .I directory1 directory2 .RS -4 .PP Report only sticky bits differences, ignore any missing files: .RS 4 .PP .B tdiff \-0 \-\-mode \-\-mode\-and 1000 .I directory1 directory2 .RS -2 .PP or: .RS 2 .PP .B tdiff \-0 \-\-mode \-\-mode\-or 6777 .I directory1 directory2 .RS -4 .PP Run .B cmp \-l on every file of the same size in both trees: .RS 4 .PP .B tdiff \-0 \-\-exec cmp -l %1 %2 \\\\\/; .I directory1 directory2 .RS -4 .PP Run super-diff: diff files with .B diff \-u and reports any other kind of differences in inode contents except for times: .RS 4 .PP .B tdiff \-\-exec\-always\-diff .I directory1 directory2 .RS -2 .PP or more tersely: .RS 2 .PP .B tdiff \-W .I directory1 directory2 .RS -4 .PP Same with file modification times: .RS 4 .PP .B tdiff \-W \-\-preset mtime .I directory1 directory2 .RS -2 .PP or also: .RS 2 .PP .B tdiff \-Wi .I directory1 directory2 .RS -4 .SH REPORTING BUGS Report bugs on the .UR https://github.com/F-i-f/tdiff/issues GitHub Issues page .UE . .SH COPYRIGHT Copyright (C) 1999, 2008, 2014, 2019, 2024 Philippe Troin ( .UR https://github.com/F-i-f F-i-f on GitHub .UE ). .PP .B tdiff comes with ABSOLUTELY NO WARRANTY. .br This is free software, and you are welcome to redistribute it under certain conditions. .br You should have received a copy of the GNU General Public License along with this program. If not, see .UR http://www.gnu.org/licenses/ .UE . .SH SEE ALSO .BR acl_set_file(1) , .BR chmod(1) , .BR diff(1) , .BR getfacl(1) , .BR getfattr(1) , .BR open(2) , .BR setxattr(2) , .BR stat(2) . \" LocalWords: tdiff Troin phil MERCHANTABILITY inode fI fR fB dirs \" LocalWords: DIRECTORY1 DIRECTORY2 fBtdiff fBd fRirectory TP fBh \" LocalWords: fRelp fBm fRode bitmasks fRodes fBt fRype fBv br acl \" LocalWords: fRerbosity fRersion nlink xattr fBb dtmfugsbcnejkql \" LocalWords: ctime mtime atime fRlock fIst fBc DTMFUGZIRSBCNEJKQL \" LocalWords: inodes fRontent fBg fRroup fBi fRme fRmes fBj fRor \" LocalWords: ACLs fBn fIlinks fBo setxattr NOATIME fBs fBu fRser \" LocalWords: fRize getfacl getfattr fICOMMAND fIFILE fIMASK chmod \" LocalWords: directory1 directory2 fIDIRECTORY2 cmp IP uid fIdir1 \" LocalWords: fIDIRECTORY1 gid UFS MacOSX vv vvv vvvv fI0x UE fR's \" LocalWords: fIfile1 fIfile2 fIdir2 files' readdir eg hardlinks \" LocalWords: fBf1 fBf2 fBf3 fIamtimes fIam fImissing fImiss fId \" LocalWords: fBf fRlags fIdefault fI9 fI8 fI7 fI6 notimes fI0 fI1 \" LocalWords: fI2 fI3 fI4 fI5 amtimes alltimes Wi ns fBa fRnd fRr \" LocalWords: fBL fRs gtkdiff fBNO symlinks fBO fRllow dereference \" LocalWords: dereferenced readlink NOFOLLOW readlinkat