Apparently I have a different manpage.
-i, --ignore-case
Ignore case distinctions, so that characters that differ only in
case match each other.
In any case, it's not about the filenames.
It ignores case in the file (contents) but also in the pattern.
Test file:
___________
Hello World
^^^^^^^^^^^
Grep results (ignore case of file contents):
$ grep hello test.txt
$ grep Hello test.txt
Hello World
$ grep -i HELLO test.txt
Hello World
$ grep -i hello test.txt
Hello World
Grep results (ignore case of pattern):
$ grep [a-Z] test.txt
grep: Invalid range end
$ grep -i [a-Z] test.txt
Hello World
$ grep -i [A-z] test.txt
Hello World
$ grep [A-z] test.txt
___________
Hello World
^^^^^^^^^^^
As you can see the results can sometimes be a little unexpected.
Not sure if there is an example where this actually matters more.
whatever, which the accepted answer does not in any way address. I am not aware of any version of grep that will look inWHATEVERwhen you ask it to look inwhatever, under any circumstances. The accepted answer addressesgrep -i PATTERN whatever, which is notgrep -i pattern WHATEVER. Case-sensitivity of filenames is a *nix thing, not agrepthing.