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

What's a good way to check if my file system is case-sensitive (with file names) on Windows, Mac, and Linux?

share|improve this question
Aside from reading the doco, do you mean? – JdeBP Dec 23 '11 at 11:08
up vote -1 down vote accepted

Write a script that enumerates some files, change the case on the filenames, then see if those new filenames exist (without modifying any files or writing anything to the filesystem). If they do, the filesystem is not case-sensitive. I would check a number of files in case there happens to be both "myfile" and "MYFILE" in the same directory.

share|improve this answer
Actually, you'd need to check that both files exist. NTFS is case-preserving, but the win32 subsystem is case-insensitive. So a rename would work and the filename would be changed, but if you tried to create a different file with the same name with different cases, it would fail or overwrite (depending on what you asked for). – afrazier Dec 7 '11 at 17:56
Right - if both files exist, then the filesystem is not case-sensitive. If a file exists on NTFS with the name "myfile" and I check for the existence of "MYFILE", it will say that the file exists (the first step in my solution is to enumerate some files, so a check on the originals would be redundant). – Brian Dec 7 '11 at 19:02

A simpler way to do this is run: touch canCase && touch cancase and then check if two or one files were created. If one file is created, your OS is not case sensitive.

share|improve this answer

You must log in to answer this question.

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