Skip to content

Instantly share code, notes, and snippets.

@gaebor
Last active June 3, 2018 20:54
Show Gist options
  • Save gaebor/546b7df2b9482029e2c0deda81fa1a28 to your computer and use it in GitHub Desktop.
Save gaebor/546b7df2b9482029e2c0deda81fa1a28 to your computer and use it in GitHub Desktop.
Directory name case (in)sensitivity on Windows

Case (in)sensitivity

You won't believe this!

Let's say that you make a folder in Bash on Ubuntu on Windows

bash -c "mkdir zZz"

As you may know, files on Windows are case insensitive, so you can:

dir zZz
dir ZzZ
dir ZZZ

All the same. But watch this:

mkdir zZz\x

After this the folder x in zZz is case sensitive and this is wrong:

dir zZz\X

Also it doesn't matter on the original folder name, because this is works:

dir ZzZ\x

Even if you rename/move the folder xXx the subdirectories stay case sensitive (but not the original folder itself).

bash -c "mkdir zZz"
mkdir zZz\x
REM OK
dir zZz\x
REM WRONG
dir zZz\X
REM OK
dir zZZ\x
REM WRONG
dir zZZ\X
move zZz yYy
REM OK
dir yYy\x
REM WRONG
dir yYy\X
mkdir xXx
mkdir xXx\x
REM OK
dir xXx\x
REM OK
dir xXx\X
REM OK
dir xXX\X
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment