Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

For instance:

./Root/Directory/FileName.txt
./Branch/directory/filename.txt

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

share|improve this question

1 Answer 1

up vote 4 down vote accepted

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

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

e.g.

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

 
discard

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.