bash
diff -rq -x 'filter_path' 'dir1' 'dir2'
python
import filecmp
def dir_compare(src, target, ignore=[]):
def diff_files(dcmp):
for name in dcmp.diff_files:
diff_rst.append(os.path.join(dcmp.left, name))
for name in dcmp.left_only:
diff_rst.append(os.path.join(dcmp.left, name))
for sub_dcmp in dcmp.subdirs.values():
diff_files(sub_dcmp)
diff_rst = []
dcmp = filecmp.dircmp(src, target, ignore)
diff_files(dcmp)
return (diff_rst)