Use diff and ignore empty directories

Viewed 1176

This is my tree

├── test
│   ├── dir1
│   └── dir2
│       ├── file
│       └── file2
└── test2
    └── dir2
        ├── file
        └── file2

I use diff: diff -r test/ test2/

Only in test: dir1

So the only difference is that there is an empty directory (dir1) in in test/ which does not exist in test2/.

I want to ignore empty directories as a difference. So I want in this case that diff tells me that the content of test/ is the same as the content of test2/

How can I achieve this?

1 Answers
Related