Linux Essentials (010-160) — Question 79

Which of the following commands finds all lines in the file operating-systems.txt which contain the term linux, regardless of the case?

Answer options

Correct answer: C

Explanation

The correct answer is C, as 'grep -i' is specifically designed to search for text patterns while ignoring case. Options A and B are incorrect because 'igrep' is not a standard command and 'less -i' does not perform a search in the same way. Option D is wrong because 'cut' is used for cutting sections from lines, not searching. Option E, while it attempts to match the case variations, is unnecessarily complex and not the standard method for case-insensitive searching.