-
Notifications
You must be signed in to change notification settings - Fork 2
/
tdiff.1.html
1231 lines (943 loc) · 38.4 KB
/
tdiff.1.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!-- Creator : groff version 1.23.0 -->
<!-- CreationDate: Tue Feb 6 10:48:38 2024 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="generator" content="groff -Thtml, see www.gnu.org">
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta name="Content-Style" content="text/css">
<style type="text/css">
p { margin-top: 0; margin-bottom: 0; vertical-align: top }
pre { margin-top: 0; margin-bottom: 0; vertical-align: top }
table { margin-top: 0; margin-bottom: 0; vertical-align: top }
h1 { text-align: center }
</style>
<title>TDIFF</title>
</head>
<body>
<h1 align="center">TDIFF</h1>
<a href="#NAME">NAME</a><br>
<a href="#SYNOPSIS">SYNOPSIS</a><br>
<a href="#DESCRIPTION">DESCRIPTION</a><br>
<a href="#OPTIONS">OPTIONS</a><br>
<a href="#Standard Options">Standard Options</a><br>
<a href="#Toggle Options">Toggle Options</a><br>
<a href="#Preset Options">Preset Options</a><br>
<a href="#Other Miscellaneous Options">Other Miscellaneous Options</a><br>
<a href="#HARD LINKS">HARD LINKS</a><br>
<a href="#CONTENTS COMPARISONS">CONTENTS COMPARISONS</a><br>
<a href="#EXIT STATUS">EXIT STATUS</a><br>
<a href="#EXAMPLES">EXAMPLES</a><br>
<a href="#REPORTING BUGS">REPORTING BUGS</a><br>
<a href="#COPYRIGHT">COPYRIGHT</a><br>
<a href="#SEE ALSO">SEE ALSO</a><br>
<hr>
<h2>NAME
<a name="NAME"></a>
</h2>
<p style="margin-left:9%; margin-top: 1em">tdiff −
tree diff, list differences between various inode attributes
( <b>stat(2)</b> structure) and contents for two directory
trees</p>
<h2>SYNOPSIS
<a name="SYNOPSIS"></a>
</h2>
<p style="margin-left:9%; margin-top: 1em"><b>tdiff</b>
[<i>OPTIONS</i>]... <i>DIRECTORY1 DIRECTORY2</i></p>
<h2>DESCRIPTION
<a name="DESCRIPTION"></a>
</h2>
<p style="margin-left:9%; margin-top: 1em">List differences
between <i>DIRECTORY1</i> and <i>DIRECTORY2</i> file trees,
comparing any of the inode attributes, also known as
<b>stat(2)</b> structure members. Inode attributes are:</p>
<table width="100%" border="0" rules="none" frame="void"
cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="13%"></td>
<td width="1%">
<p>•</p></td>
<td width="3%"></td>
<td width="71%">
<p>file type (regular file, directory, FIFO, socket,
etc.),</p> </td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
<td width="13%"></td>
<td width="1%">
<p>•</p></td>
<td width="3%"></td>
<td width="71%">
<p>file size,</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
<td width="13%"></td>
<td width="1%">
<p>•</p></td>
<td width="3%"></td>
<td width="71%">
<p>file block count (physical storage size),</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
<td width="13%"></td>
<td width="1%">
<p>•</p></td>
<td width="3%"></td>
<td width="71%">
<p>owner uid and gid,</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
<td width="13%"></td>
<td width="1%">
<p>•</p></td>
<td width="3%"></td>
<td width="71%">
<p>access, modification and inode change times,</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
<td width="13%"></td>
<td width="1%">
<p>•</p></td>
<td width="3%"></td>
<td width="71%">
<p>the set of hard links a file has,</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
<td width="13%"></td>
<td width="1%">
<p>•</p></td>
<td width="3%"></td>
<td width="71%">
<p>extended attributes (if supported),</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
<td width="13%"></td>
<td width="1%">
<p>•</p></td>
<td width="3%"></td>
<td width="71%">
<p>ACLs (if supported),</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
<td width="13%"></td>
<td width="1%">
<p>•</p></td>
<td width="3%"></td>
<td width="71%">
<p>file system flags (BSD UFS, MacOSX).</p></td>
<td width="12%">
</td></tr>
</table>
<p style="margin-left:9%; margin-top: 1em">By default,
<b>tdiff</b> 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.</p>
<p style="margin-left:9%; margin-top: 1em">Beyond inode
attribute checks, <b>tdiff</b> can check (and will check by
default) regular files for contents difference. Optionally,
<b>tdiff</b> can use an external program to determine if the
files are considered to be different. See the
<b>−x</b>/<b>−−exec</b>,
<b>−w</b>/<b>−−exec−always</b>, and
<b>−W</b>/<b>−−exec−always−diff</b>
options.</p>
<h2>OPTIONS
<a name="OPTIONS"></a>
</h2>
<h3>Standard Options
<a name="Standard Options"></a>
</h3>
<p style="margin-left:9%; margin-top: 1em"><b>−h</b>,
<b>−−help</b></p>
<p style="margin-left:18%;">Show a short <b>h</b>elp
message and exit.</p>
<p style="margin-left:9%;"><b>−v</b>,
<b>−−verbose</b></p>
<p style="margin-left:18%;">Increase <b>v</b>erbosity. Four
cumulative levels of logging verbosity are supported:</p>
<table width="100%" border="0" rules="none" frame="void"
cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="22%"></td>
<td width="6%">
<p><b>-v</b></p></td>
<td width="3%"></td>
<td width="69%">
<p>report overall statistics: total number of files
scanned, compared, etc.</p></td></tr>
<tr valign="top" align="left">
<td width="22%"></td>
<td width="6%">
<p><b>-vv</b></p></td>
<td width="3%"></td>
<td width="69%">
<p>report if any files are skipped, and for what reason
(exclusion, already compared, etc.)</p></td></tr>
<tr valign="top" align="left">
<td width="22%"></td>
<td width="6%">
<p><b>-vvv</b></p></td>
<td width="3%"></td>
<td width="69%">
<p>report internal data structure statistics.</p></td></tr>
<tr valign="top" align="left">
<td width="22%"></td>
<td width="6%">
<p><b>-vvvv</b></p></td>
<td width="3%"></td>
<td width="69%">
<p>report memory statistics (if available on your
system).</p> </td></tr>
</table>
<p style="margin-left:9%;"><b>−V</b>,
<b>−−version</b></p>
<p style="margin-left:18%;">Show the <b>tdiff v</b>ersion
information, compiled-in features and flags (if any) then
exit. <br>
The compiled-in feature list shows which features
<b>tdiff</b> has been compiled with: O_NOATIME, flags, acl,
and xattr support, acl optimization (<b>acl_cmp</b>), the
<b>readdir(2)</b> implementation used, the file system time
granularity (either seconds (<i>s</i>) or nanoseconds
(<i>ns</i>)) and if comparing symbolic links will update
their access time (<b>readlink=readlink</b>) or not
(<b>readlink=open(O_PATH|O_NOFOLLOW)+readlinkat</b>). <br>
If flags support is compiled in, the list of recognized
flags will be listed as well.</p>
<h3>Toggle Options
<a name="Toggle Options"></a>
</h3>
<p style="margin-left:9%; margin-top: 1em">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.</p>
<p style="margin-left:9%; margin-top: 1em">The long toggle
options are named after the <b>stat(2)</b> structure names:
for example, <b>−−mtime</b> is used to check the
<i>st_mtime</i> <b>stat(2)</b> structure member, which is
the file modification time. Similarly to short toggle
options, long toggle options have a
<b>−−no−</b> version to turn off the
equivalent check (eg. <b>−−no−mtime</b>).
<b><br>
−b</b>, <b>−−blocks</b></p>
<p style="margin-left:18%;">Report file <b>b</b>lock count
differences (<i>st_blocks</i>) except for directories which
are ignored. <br>
This is on by default.</p>
<p style="margin-left:9%;"><b>−B</b>,
<b>−−no−blocks</b></p>
<p style="margin-left:18%;">Do not report file <b>b</b>lock
count differences.</p>
<p style="margin-left:9%;"><b>−c</b>,
<b>−−contents</b></p>
<p style="margin-left:18%;">Report file <b>c</b>ontent
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</b> section below for the
exact semantics. <br>
This is on by default.</p>
<p style="margin-left:9%;"><b>−C</b>,
<b>−−no−contents</b></p>
<p style="margin-left:18%;">Do not report file
<b>c</b>ontent differences.</p>
<p style="margin-left:9%;"><b>−d</b>,
<b>−−dirs</b></p>
<p style="margin-left:18%;">Diff <b>d</b>irectory contents:
report if any file is present in only one directory. <br>
This is on by default.</p>
<p style="margin-left:9%;"><b>−D</b>,
<b>−−no−dirs</b></p>
<p style="margin-left:18%;">Do not diff <b>d</b>irectory
contents: files only present in a single directory are not
reported.</p>
<p style="margin-left:9%;"><b>−e</b>,
<b>−−hardlinks</b></p>
<p style="margin-left:18%;">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</b> will report that the files are hard links only
in the first directory. <b><br>
tdiff</b> will only report the differences once per set of
hard links: if in a directory <b>f1</b>, <b>f2</b> and
<b>f3</b> are hard links while in the other <b>f1</b> and
<b>f2</b> are hard links while <b>f3</b> exists but is not a
hard link, <b>tdiff</b> will report that <b>f1</b> is only
linked to <b>f3</b> in the first directory but will not
report the same information for <b>f2</b> because <b>f1</b>
and <b>f2</b> are part of the same set of hard linked files.
<br>
This is on by default.</p>
<p style="margin-left:9%;"><b>−E</b>,
<b>−−no−hardlinks</b></p>
<p style="margin-left:18%;">Will not report any differences
in hard links sets.</p>
<p style="margin-left:9%;"><b>−f</b>,
<b>−−flags</b></p>
<p style="margin-left:18%;">Diff file system <b>f</b>lags,
as found in the <b>stat(2)</b> <i>st_flags</i> structure
member. This is only supported on BSD, MacOSX and other
systems that have <i>st_flags</i>. <b><br>
tdiff --version</b> will list which file system flags
<b>tdiff</b> has been compiled with, but <b>tdiff</b> 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 <b>stat(2)</b>
structure has <i>st_flags</i>.</p>
<p style="margin-left:9%;"><b>−F</b>,
<b>−−no−flags</b></p>
<p style="margin-left:18%;">Do not diff file system
<b>f</b>lags.</p>
<p style="margin-left:9%;"><b>−g</b>,
<b>−−gid</b></p>
<p style="margin-left:18%;">Report on any differences in
file <b>g</b>roup ownership (owner group id, <i>st_gid</i>).
<br>
This is on by default.</p>
<p style="margin-left:9%;"><b>−G</b>,
<b>−−no−gid</b></p>
<p style="margin-left:18%;">Do not report any differences
in file <b>g</b>roup ownership (owner group id).</p>
<p style="margin-left:9%;"><b>−i</b>,
<b>−−mtime</b></p>
<p style="margin-left:18%;">Report on any differences in
file modification t<b>i</b>me (<i>st_mtime</i>), up to
nanosecond resolution if the underlying OS reports it.</p>
<p style="margin-left:9%;"><b>−I</b>,
<b>−−no−mtime</b></p>
<p style="margin-left:18%;">Do not report any differences
in file modification t<b>i</b>mes (<i>st_mtime</i>). <br>
This is on by default.</p>
<p style="margin-left:9%;"><b>−j</b>,
<b>−−major</b></p>
<p style="margin-left:18%;">For device files (either block
or character), report any differences in ma<b>j</b>or 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.</p>
<p style="margin-left:9%;"><b>−J</b>,
<b>−−no−major</b></p>
<p style="margin-left:18%;">Do not report any differences
in ma<b>j</b>or device numbers on device files.</p>
<p style="margin-left:9%;"><b>−k</b>,
<b>−−minor</b></p>
<p style="margin-left:18%;">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.</p>
<p style="margin-left:9%;"><b>−K</b>,
<b>−−no−minor</b></p>
<p style="margin-left:18%;">Do not report any differences
in minor device numbers on device files.</p>
<p style="margin-left:9%;"><b>−l</b>,
<b>−−acl</b></p>
<p style="margin-left:18%;">Report on any differences in
file AC<b>L</b>s as defined by <b>acl_set_file(3)</b>. <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.</p>
<p style="margin-left:9%;"><b>−L</b>,
<b>−−no−acl</b></p>
<p style="margin-left:18%;">Do not report any differences
in file AC<b>L</b>s.</p>
<p style="margin-left:9%;"><b>−m</b>,
<b>−−mode</b></p>
<p style="margin-left:18%;">Report on any differences in
file access <b>m</b>ode (permission bits as set by
<b>chmod(1)</b>). If set,
<b>−o</b>/<b>−−mode−or</b> and
<b>−a</b>/<b>−−mode−and</b> bitmasks
are applied, if set. <br>
This is on by default.</p>
<p style="margin-left:9%;"><b>−M</b>,
<b>−−no−mode</b></p>
<p style="margin-left:18%;">Do not report any differences
in file access <b>m</b>odes (permission bits).</p>
<p style="margin-left:9%;"><b>−n</b>,
<b>−−nlink</b></p>
<p style="margin-left:18%;">Report on any differences in
file (hard) link counts (<i>st_</i><b>n</b><i>links</i>).
<br>
This is on by default.</p>
<p style="margin-left:9%;"><b>−N</b>,
<b>−−no−nlink</b></p>
<p style="margin-left:18%;">Do not report any differences
in file (hard) link counts.</p>
<p style="margin-left:9%;"><b>−q</b>,
<b>−−xattr</b></p>
<p style="margin-left:18%;">Report on any differences in
file extended attributes as defined by <b>setxattr(2)</b>.
<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.</p>
<p style="margin-left:9%;"><b>−Q</b>,
<b>−−no−xattr</b></p>
<p style="margin-left:18%;">Do not report any differences
in file extended attributes.</p>
<p style="margin-left:9%;"><b>−s</b>,
<b>−−size</b></p>
<p style="margin-left:18%;">Report file <b>s</b>ize
differences (<i>st_size</i>), except for directories which
are ignored. <br>
This is on by default.</p>
<p style="margin-left:9%;"><b>−S</b>,
<b>−−no−size</b></p>
<p style="margin-left:18%;">Do not report file <b>s</b>ize
differences.</p>
<p style="margin-left:9%;"><b>−t</b>,
<b>−−type</b></p>
<p style="margin-left:18%;">Report file <b>t</b>ype
differences (files, directories, symbolic links, etc.) <br>
This is on by default.</p>
<p style="margin-left:9%;"><b>−T</b>,
<b>−−no−type</b></p>
<p style="margin-left:18%;">Do not report file <b>t</b>ype
differences between the two compared directories.</p>
<p style="margin-left:9%;"><b>−u</b>,
<b>−−uid</b></p>
<p style="margin-left:18%;">Report on any differences in
file <b>u</b>ser ownership (owner user id, <i>st_uid</i>).
<br>
This is on by default.</p>
<p style="margin-left:9%;"><b>−U</b>,
<b>−−no−uid</b></p>
<p style="margin-left:18%;">Do not report any differences
in file <b>u</b>ser ownership (owner user id).</p>
<p style="margin-left:9%;"><b>−y</b>,
<b>−−atime</b></p>
<p style="margin-left:18%;">Report on any differences in
file access time (<i>st_atime</i>), 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</b> will not update the file access times when
comparing files if compiled on an OS with <b>O_NOATIME
open(2)</b> support, whenever possible. One of the Operating
Systems with <b>O_NOATIME</b> support, Linux, only allows to
open a file with <b>O_NOATIME</b> if <b>tdiff</b> is ran by
the file owner or root. All files for which this is the case
will then be opened with <b>NO_ATIME</b>, but <b>tdiff</b>
will silently drop the <b>O_NOATIME</b> flag if a
<i>Permission denied</i> error is encountered. Please also
note that commands specified with
<b>−x</b>/<b>−−exec</b>,
<b>−w</b>/<b>−−exec−always</b> or
<b>−W</b>/<b>−−exec−always−diff</b>
may update the access times of the files they read.</p>
<p style="margin-left:9%;"><b>−Y</b>,
<b>−−no−atime</b></p>
<p style="margin-left:18%;">Do not report any differences
in file access times (<i>st_atime</i>). <br>
This is on by default.</p>
<p style="margin-left:9%;"><b>−z</b>,
<b>−−ctime</b></p>
<p style="margin-left:18%;">Report on any differences in
file inode change time (<i>st_ctime</i>), 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).</p>
<p style="margin-left:9%;"><b>−Z</b>,
<b>−−no−ctime</b></p>
<p style="margin-left:18%;">Do not report any differences
in file file inode change times (<i>st_ctime</i>). <br>
This is on by default.</p>
<h3>Preset Options
<a name="Preset Options"></a>
</h3>
<p style="margin-left:9%; margin-top: 1em">The preset
single letter options are either a numeric preset level from
<i>0</i> to <i>9</i>, or <b>−p</b> followed by a
preset name or level. Presets can also be activated with the
<b>−−preset</b> 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, <b>−−preset</b>
<i>amtimes</i> can be shortened to <i>am</i>, <i>missing</i>
to <i>miss</i>, <i>default</i> to <i>d</i>, etc.</p>
<p style="margin-left:9%; margin-top: 1em">The presets are
cumulative, preset level <i>9</i> is a super-set of preset
level <i>8</i>, itself a super-set of level <i>7</i> and so
on.</p>
<p style="margin-left:9%; margin-top: 1em">The default
preset level when <b>tdiff</b> starts parsing its options is
preset <i>6</i>/<i>notimes</i>/<i>default</i>. <b><br>
−0</b>, <b>−p</b>|<b>−−preset</b>
<i>0</i>|<i>none</i></p>
<p style="margin-left:18%;">Do not check anything. All the
toggles are set to their inactive
(<b>−−no−</b>) state. <br>
If only this preset is active (it is provided last on the
command line for example), <b>tdiff</b> will not report
anything but will still traverse the file trees. This is
only useful to reset <b>tdiff</b>’s set of comparisons
to the empty set and add exactly which fields should be
compared with further toggle options.</p>
<p style="margin-left:9%;"><b>−1</b>,
<b>−p</b>|<b>−−preset</b>
<i>1</i>|<i>missing</i>|<i>type</i></p>
<p style="margin-left:18%;">Report missing files and
different file types. <b><br>
tdiff</b> will only emit messages for either files missing
in either directory
(<b>−d</b>/<b>−−dirs</b>) or if they are
of different file types
(<b>−t</b>/<b>−−type</b>). All the other
toggles are set to their inactive
(<b>−−no−</b>) state.</p>
<p style="margin-left:9%;"><b>−2</b>,
<b>−p</b>|<b>−−preset</b>
<i>2</i>|<i>mode</i></p>
<p style="margin-left:18%;">In addition to the comparisons
enabled at preset level <i>1</i>, <b>tdiff</b> will also
enable file mode comparisons
(<b>−m</b>/<b>−−mode</b>). All the other
toggles are set to their inactive
(<b>−−no−</b>) state.</p>
<p style="margin-left:9%;"><b>−3</b>,
<b>−p</b>|<b>−−preset</b>
<i>3</i>|<i>owner</i></p>
<p style="margin-left:18%;">In addition to the comparisons
enabled at preset level <i>2</i>, <b>tdiff</b> will also
enable user id (<b>−u</b>/<b>−−uid</b>),
group id (<b>−g</b>/<b>−−gid</b>) and, if
supported, Access Control Lists
(<b>−l</b>/<b>−−acl</b>) comparisons. All
the other toggles are set to their inactive
(<b>−−no−</b>) state.</p>
<p style="margin-left:9%;"><b>−4</b>,
<b>−p</b>|<b>−−preset</b>
<i>4</i>|<i>hardlinks</i></p>
<p style="margin-left:18%;">In addition to the comparisons
enabled at preset level <i>3</i>, <b>tdiff</b> will also
enable link count
(<b>−n</b>/<b>−−nlink</b>) and hard link
targets (<b>−e</b>/<b>−−hardlinks</b>)
comparisons. All the other toggles are set to their inactive
(<b>−−no−</b>) state.</p>
<p style="margin-left:9%;"><b>−5</b>,
<b>−p</b>|<b>−−preset</b>
<i>5</i>|<i>contents</i></p>
<p style="margin-left:18%;">In addition to the comparisons
enabled at preset level <i>4</i>, <b>tdiff</b> will also
compare file contents
(<b>−c</b>/<b>−−contents</b>), size
(<b>−s</b>/<b>−−size</b>), block usage
(<b>−b</b>/<b>−−blocks</b>), and for
device files, major
(<b>−j</b>/<b>−−major</b>) and minor
(<b>−k</b>/<b>−−minor</b>) device numbers.
All the other toggles are set to their inactive
(<b>−−no−</b>) state.</p>
<p style="margin-left:9%;"><b>−6</b>,
<b>−p</b>|<b>−−preset</b>
<i>6</i>|<i>notimes</i>|<i>default</i></p>
<p style="margin-left:18%;">In addition to the comparisons
enabled at preset level <i>5</i>, <b>tdiff</b> will also
compare, if supported, flags
(<b>−f</b>/<b>−−flags</b>) and extended
attributes (<b>−q</b>/<b>−−xattr</b>). All
the other toggles are set to their inactive
(<b>−−no−</b>) state. This corresponds to
a state where all toggles are on except the three times
(<b>−y</b>/<b>−−atime</b>,
<b>−i</b>/<b>−−mtime</b> and
<b>−z</b>/<b>−−ctime</b>) that are off.
<br>
If your system does not support either flags or extended
attributes, then preset level <i>6</i> is equivalent to
preset level <i>5</i>. <br>
This is the default preset level.</p>
<p style="margin-left:9%;"><b>−7</b>,
<b>−p</b>|<b>−−preset</b>
<i>7</i>|<i>mtime</i></p>
<p style="margin-left:18%;">In addition to the comparisons
enabled at preset level <i>6</i>, <b>tdiff</b> will also
compare file modification times
(<b>−i</b>/<b>−−mtime</b>). This
corresponds to a state where all toggles are on except the
file access time
(<b>−y</b>/<b>−−atime</b>) and the inode
modification time
(<b>−z</b>/<b>−−ctime</b>) that are
off.</p>
<p style="margin-left:9%;"><b>−8</b>,
<b>−p</b>|<b>−−preset</b>
<i>8</i>|<i>amtimes</i></p>
<p style="margin-left:18%;">In addition to the comparisons
enabled at preset level <i>7</i>, <b>tdiff</b> will also
compare file access times
(<b>−y</b>/<b>−−atime</b>). This
corresponds to a state where all toggles are on except the
inode modification time
(<b>−z</b>/<b>−−ctime</b>) that is
off.</p>
<p style="margin-left:9%;"><b>−9</b>,
<b>−p</b>|<b>−−preset</b>
<i>9</i>|<i>alltimes</i>|<i>all</i></p>
<p style="margin-left:18%;"><b>tdiff</b> will compare all
available attributes, turning all toggles on.</p>
<h3>Other Miscellaneous Options
<a name="Other Miscellaneous Options"></a>
</h3>
<p style="margin-left:9%; margin-top: 1em"><b>−a</b>,
<b>−−mode−and</b> <i>MASK</i></p>
<p style="margin-left:18%;">When comparing file permission
bits, perform a binary <b>a</b>nd between the permission
bits and <i>MASK</i> before comparing them. <i><br>
MASK</i> is specified in octal, like with <b>chmod(2)</b>,
unless prefixed with <i>0x</i>, in which case it is parsed
as hexadecimal.</p>
<p style="margin-left:9%;"><b>−o</b>,
<b>−−mode−or</b> <i>MASK</i></p>
<p style="margin-left:18%;">When comparing file permission
bits, perform a binary <b>o</b>r between the permission bits
and <i>MASK</i> before comparing them. <i><br>
MASK</i> is specified in octal, like with <b>chmod(2)</b>,
unless prefixed with <i>0x</i>, in which case it is parsed
as hexadecimal.</p>
<p style="margin-left:9%;"><b>−w</b>,
<b>−−exec−always</b> <i>COMMAND...
\;</i></p>
<p style="margin-left:18%;">Always execute <i>COMMAND</i>
for any pair of matching regular files found in the trees.
Refer to the <b>CONTENTS COMPARISONS</b> 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 <b>-c</b>/<b>--contents</b>
toggle.</p>
<p style="margin-left:9%;"><b>−W</b>,
<b>−−exec−always−diff</b></p>
<p style="margin-left:18%;">Always execute <i>diff
−u</i> for any pair of matching regular files found in
the trees. This is a shortcut for:</p>
<p style="margin-left:21%;"><b>tdiff
−−exec−always diff −u %1 %2
\;</b></p>
<p style="margin-left:18%;">The option will supersede
whichever command was specified in a
<b>−w</b>/<b>−−exec−always</b>
option appearing earlier on the option list. <br>
Using either option turns on the <b>-c</b>/<b>--contents</b>
toggle.</p>
<p style="margin-left:9%;"><b>−x</b>,
<b>−−exec</b> <i>COMMAND... \;</i></p>
<p style="margin-left:18%;">Uses <i>COMMAND</i> when
comparing files whose sizes are the same. Refer to the
<b>CONTENTS COMPARISONS</b> 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 <b>-c</b>/<b>--contents</b>
toggle.</p>
<p style="margin-left:9%;"><b>−X</b>,
<b>−−exclude</b> <i>FILE</i></p>
<p style="margin-left:18%;">Excludes <i>FILE</i> from
processing: any discrepancies on a file or missing file
named <i>FILE</i> will not be reported. Neither will
external commands be ran on them. If <i>FILE</i> 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.</p>
<p style="margin-left:9%;"><b>−O</b>,
<b>−−follow−symlinks</b></p>
<p style="margin-left:18%;">Completely ignore symbolic
links and always f<b>O</b>llow and dereference them. <br>
This is off by default (symbolic links are not followed /
dereferenced).</p>
<h2>HARD LINKS
<a name="HARD LINKS"></a>
</h2>
<p style="margin-left:9%; margin-top: 1em"><b>tdiff</b>
optimizes for hard links in two ways:</p>
<table width="100%" border="0" rules="none" frame="void"
cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="13%"></td>
<td width="1%">
<p>•</p></td>
<td width="3%"></td>
<td width="83%">
<p><b>tdiff</b> will skip examining a pair of files if it
has already compared the pair’s hard links copies.</p></td></tr>
</table>
<p style="margin-left:17%; margin-top: 1em">For example, if
you have <i>file1</i> hard linked to <i>file2</i> in both
<i>DIRECTORY1</i> and <i>DIRECTORY2</i>, <b>tdiff</b> will
only report any differences for <i>file1</i> and will skip
<i>file2</i> entirely since it’s linked to
<i>file1</i> in both examined directories, and the list of
differences would the same as for the already reported
<i>file1</i> case.</p>
<table width="100%" border="0" rules="none" frame="void"
cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="13%"></td>
<td width="1%">
<p style="margin-top: 1em">•</p></td>
<td width="3%"></td>
<td width="61%">
<p style="margin-top: 1em"><b>tdiff</b> will skip examining
two hard-linked files.</p></td>
<td width="22%">
</td></tr>
</table>
<p style="margin-left:17%; margin-top: 1em">For example, if
<i>dir1/file</i> is hard linked to <i>dir2/file</i>, then
<b>tdiff</b> will omit examining the file pair entirely
since they really are the same object and would have no
differences at all.</p>
<p style="margin-left:9%; margin-top: 1em"><b>tdiff</b>’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</b> run. This is generally
the case for traditional file systems.</p>
<p style="margin-left:9%; margin-top: 1em"><b>tdiff</b> can
optionally show which hard linked files are skipped and for
what reason when run at the verbosity level 2 or above
(<b>-vv</b> or <b>--verbose --verbose</b>).</p>
<h2>CONTENTS COMPARISONS
<a name="CONTENTS COMPARISONS"></a>
</h2>
<p style="margin-left:9%; margin-top: 1em"><b>tdiff</b>
uses built-in code for file contents comparisons. It avoid
running an actual comparison if the file’s sizes
(<i>st_size</i>) 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.</p>
<p style="margin-left:9%; margin-top: 1em">Optionally,
<b>tdiff</b> can run external commands to perform the
comparison. When providing an external command, the
<i>COMMAND</i> must be passed as multiple arguments
terminated by a semi-colon, which must be escaped to avoid
processing by the shell. <i>COMMAND</i> should not be quoted
as a single argument. <br>
In the arguments can appear the strings <i>%1</i> and
<i>%2</i> which will be respectively replaced by the paths
to files in the first and second compared directories.
<i>%1</i> and <i>%2</i> can only appear once on the command
line, and must be full words: they cannot appear inside a
larger shell word. <br>
For example:</p>
<p style="margin-left:12%;"><b>tdiff --exec gtkdiff %1 %2
\; directory1 directory2</b></p>
<p style="margin-left:9%; margin-top: 1em">If either the
<b>−x</b> or <b>−−exec</b> 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</b> will not print any error message if the
files are different, the command used for
<b>−x</b>/<b>−−exec</b> should take care
of reporting the error. Note that the command <i>will not be
ran if</i> <b>tdiff</b> <i>can find via the file size</i>
that the files differ by virtue of having different
sizes.</p>
<p style="margin-left:9%; margin-top: 1em">If either the
<b>−w</b>/<b>−−exec−always</b> or
<b>−W</b>/<b>−−exec−always−diff</b>
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
<b>−w</b>/<b>−−exec−always</b>/<b>−W</b>/<b>−−exec−always−diff</b>
command will run. <b>tdiff</b> will record a difference if
the
<b>−w</b>/<b>−−exec−always</b>/<b>−W</b>/<b>−−exec−always−diff</b>