Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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:

./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
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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .