Question 190
A RHEL 10 operator analyzes log /var/log/app09.log and needs to count lines that contain the literal word started. Which command implements the required grep behavior?
Explanation
Correct Answer
-c prints the number of matching lines rather than their text. This matches the stated requirement to count lines that contain the literal word started. By contrast, the plausible alternative `grep -i "started" /var/log/app09.log` has the effect: -i makes the text match case-insensitive; that operation would not achieve the requested result.
Incorrect Answers
-i makes the text match case-insensitive. The stated task is to count lines that contain the literal word started. Instead, `grep -c "started" /var/log/app09.log` is the relevant alternative because -c prints the number of matching lines rather than their text.
-v inverts the match, showing nonmatching lines. The stated task is to count lines that contain the literal word started. Instead, `grep -c "started" /var/log/app09.log` is the relevant alternative because -c prints the number of matching lines rather than their text.
-n prints each matching line prefixed by its line number. The stated task is to count lines that contain the literal word started. Instead, `grep -c "started" /var/log/app09.log` is the relevant alternative because -c prints the number of matching lines rather than their text.






Red Hat Certified System Administrator (RHCSA) (EX200) Practice Tests