difftree - A Shell Script to Compare Trees of Files
difftree provides much the same functionality as (GNU) diff -r.
There are a few reasons to use difftree:
-
You don't have GNU diff
-
You need more selection control of which files to compare.
-
You prefer difftree's output to GNU diff's
The difftree Usage Message
$ difftree
usage: difftree [-b] [-n] [-v] dir1 dir2 find_target [...]
Where: -b : binary comparison (use cmp instead of diff)
Where: -c : do NOT list file CONTENT difference(s)
Where: -n : list file NAME difference(s)
Where: -v : increase verbosity
Download difftree from the github repository.
difftree Examples
Compare all files in the Dir1 tree with those in the Dir2 tree.
$ difftree Dir1 Dir2 . # Note there is a '.' (dot) at the end!
!= ---------------------- 'file3' ----------------------
1c1
< Sun Oct 27 09:52:02 AEDT 2019
---
> Sun Oct 27 09:52:52 AEDT 2019
--------------------------------------------
!> ---------------------- 'Dir2:file_in_dir1_only', not found/no access
!< ---------------------- 'Dir1:file_in_dir2_only', not found/no access
!= ---------------------- 'Hello_World.java' ----------------------
1c1
< Sun Oct 27 09:54:49 AEDT 2019
---
> Sun Oct 27 09:54:52 AEDT 2019
--------------------------------------------
Compare only '*.java' files in the Dir1 tree with those in the Dir2 tree.
$ difftree Dir1 Dir2 . -name '*.java'
!= ---------------------- 'Hello_World.java' ----------------------
1c1
< Sun Oct 27 09:54:49 AEDT 2019
---
> Sun Oct 27 09:54:52 AEDT 2019
--------------------------------------------