Log files, exports, and copied status text often mix uppercase and lowercase values even when the label means the same thing. Use grep -i when a search for error also needs to catch ERROR and Error without repeating the pattern.
The -i option tells grep to ignore case while matching the pattern. It does not change the text that prints, so the output still shows the original spelling from each matching line.
The sample below uses a small local log file with three differently cased error lines and two unrelated lines. The expected proof is that grep -i 'error' prints only the three error lines, while grep -in adds line numbers without changing the match set.
Related: How to search files recursively with grep
Related: How to print context around grep matches
Related: How to count matches with grep
$ cat > app.log <<'EOF' INFO service ready error failed login for user api WARNING retry scheduled ERROR database timeout Error cache warmup failed EOF
$ grep -i 'error' app.log error failed login for user api ERROR database timeout Error cache warmup failed
grep prints the original line text. The uppercase and title-case matches prove that matching ignored letter case, not that the file was rewritten.
$ grep -in 'error' app.log 2:error failed login for user api 4:ERROR database timeout 5:Error cache warmup failed
$ grep -i 'timeout' app.log ERROR database timeout
$ rm app.log