find . -type f -exec grep -Hn WORD {} ";"
xargs is almost always a bad combination with find, because find has a lot of exec-options (-exec, -execdir, -ok, -okdir) to perform commands on files, without needing to mask whitespace or problematic characters like * and ?. No, it is not case-insensitive by default. As the doc says, case sensitivity is implementation dependent.
And NTFS is case preserving but case insensitive. That is, a file named will keep its case (case preserving); but trying and finding it by the name README.txt, say, will work (case insensitive).Readme.TXT
This is not the case on Unix systems, whose filesystems are case sensitive.
Unfortunately, there is no way around that! Other than creating your own implementation wrapping the default and make it case sensitive.Filesystem
Here is an example of a VERY limited purpose which will be able to generate a "case sensitive matching" of filename extensions:FileSystem
public final class CaseSensitiveNTFSFileSystem
extends FileSystem
{
private static final Pattern MYSYNTAX = Pattern.compile("glob:\\*(\\..*)");
private final FileSystem fs;
// "fs" is the "genuine" FileSystem provided by the JVM
public CaseSensitiveNTFSFileSystem(final FileSystem fs)
{
this.fs = fs;
}
@Override
public PathMatcher getPathMatcher(final String syntaxAndPattern)
{
final Matcher matcher = MYSYNTAX.matcher(syntaxAndPattern);
if (!matcher.matches())
throw new UnsupportedOperationException();
final String suffix = matcher.group(1);
final PathMatcher orig = fs.getPathMatcher(syntaxAndPattern);
return new PathMatcher()
{
@Override
public boolean matches(final Path path)
{
return orig.matches(path)
&& path.getFileName().endsWith(suffix);
}
};
}
// Delegate all other methods of FileSystem to "fs"
}