Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I run a recursive diff when the filenames are the same but have different cases?

For instance:


diff -r -i Root Branch only performs case insensitive on file contents not name.

share|improve this question
up vote 4 down vote accepted

The option --ignore-file-name-case is what you need:

diff -r --ignore-file-name-case Root Branch 


mkdir dir1 dir2
touch dir1/fred dir2/Fred

diff -r dir1 dir2
Only in dir1: fred
Only in dir2: Fred

diff -r --ignore-file-name-case dir1 dir2  # no output - files match
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.