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
- A. igrep linux operating-systems.txt
- B. less -i linux operating-systems.txt
- C. grep -i linux operating-systems.txt
- D. cut linux operating-systems.txt
- E. cut [Ll] [Ii] [Nn] [Uu] [Xx] operating-systems.txt
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.