Site icon LinuxCommands.site

How to grep ignore case in linux/unix

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

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.

➜  test grep -iR "use" .

Exit mobile version