grep is very useful too to match and find phrases, words and characters in test. One of the most used situation is using
grep case sensitive or case insensitive. In this tutorial we will examine different examples. We have all ready examined
grep in the following tutorial.
We will start with the default behavior of the
grep command which is case sensitive. In this example we will search for
$ grep "ismail" /etc/passwd
Now we will search for
ISMAIL in a case insensitive manner. We expect to match both
/etc/passwd file. We will use
-i option in order to specify case insensitivity.
$ grep -i "ISMAIL" /etc/passwd
Case Insensitive and Recursive
In some cases we may need to search case insensitive and recursive manner. We will use
-r option in order to make our case insensitive searchs recursively. In this case we will search for
ISMAIL case insensitive in
$ grep -r -i "ISMAIL" /etc