Which of the following options with grep is used to ignore case while searching?
Explanation
The correct option is (B) -i.
In Linux, the -i flag stands for "ignore-case." When this option is used, the search becomes case-insensitive, meaning it will match both uppercase and lowercase versions of the search pattern.
For example, to search for the word "hello" (regardless of capitalization) in a file named file.txt, you would use the following command:
grep −i "hello" file.txt
Explanation
The correct option is (B) -i.
In Linux, the -i flag stands for "ignore-case." When this option is used, the search becomes case-insensitive, meaning it will match both uppercase and lowercase versions of the search pattern.
For example, to search for the word "hello" (regardless of capitalization) in a file named file.txt, you would use the following command:
grep −i "hello" file.txt