Grep ignore case search can help us quickly search for the content we need to query.
The grep -i option can perform case insensitive matching. We can use the grep -i option to ignore case.
grep syntax
➜ ~ grep -i "keyword" file
- -i, –ignore-case
Perform case insensitive matching. By default, grep is case sensitive.
grep examples
In the following grep example, we use the grep -i option to search for keywords in the file ignores case.
➜ ~ grep -i "use" test.log
In the following grep example, we use the grep -i option and -R option to search for keywords in a directory without case-sensitivity.
- -R, -r, –recursive
Recursively search subdirectories listed.
➜ test grep -iR "use" .