测试准备:
[yz@test ~]$ sudo yum install tree [yz@test-2 ~]$ ll da/ -rw-rw-r-- 1 yz yz 3 Jan 9 08:53 f1.txt -rw-rw-r-- 1 yz yz 3 Jan 9 08:53 f2.txt [yz@test-2 ~]$ ll db/ -rw-rw-r-- 1 yz yz 3 Jan 9 08:53 f1.txt -rw-rw-r-- 1 yz yz 3 Jan 9 08:54 f2.txt -rw-rw-r-- 1 yz yz 3 Jan 9 08:54 f3.txt
[yz@test ~]$ tree da/ db/ da/ ├── f1.txt └── f2.txt db/ ├── f1.txt ├── f2.txt └── f3.txt 0 directories, 5 files
[yz@test ~]$ diff -r da/ db/ diff -r da/f1.txt db/f1.txt 1c1 < A1 --- > B1 diff -r da/f2.txt db/f2.txt 1c1 < A2 --- > B2 Only in db/: f3.txt
[yz@test ~]$ diff <(tree -Ci --noreport da/) <(tree -Ci --noreport db/) 1c1 < da/ --- > db/ 3a4 > f3.txt
[yz@test ~]$ vimdiff <(cd da/; find . | sort) <(cd db/; find . | sort)