Using Grep Case Insensitive

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/using-grep-case-insensitive/
PINTEREST
PINTEREST
INSTAGRAM

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.

Linux grep Command Tutorial with Examples

Case Sensitive

We will start with the default behavior of the grep command which is case sensitive. In this example we will search for ismail in /etc/passwd .

Case Sensitive
Case Sensitive

Case Insensitive

Now we will search for ISMAIL in a case insensitive manner. We expect to match both ismail and ISMAIL in /etc/passwd file. We will use -i option in order to specify case insensitivity.

Case Insensitive
Case Insensitive

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 /etc directory.

Case Insensitive and Recursive
Case Insensitive and Recursive

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/using-grep-case-insensitive/
PINTEREST
PINTEREST
INSTAGRAM
LEARN MORE  How To Use Regular Expression - Regex In Bash Linux?