Use the -i flag to ignore case in the results.
Let’s return back to our handy test.txt file and add “Happy” to the end:
sad
happy
awake
coffee
work
school
HappyTo ignore case differences run:
$ grep -i "happy" test.txt
happy
HappyThe uppercase variant is also an “ignore” flag, but this time we are ignoring binary files.
So if the current directory with test.txt, also contained test.pdf, the following would ignore the pdf file:
$ grep -I "happy" *
test.txt:happy