Which grep option provides only a numeric count of the matches found?

Disable ads (and more) with a premium pass for a one time $4.99 payment

Boost your Linux skills with the CompTIA Linux+ Certification Exam simulator. Engage with multiple choice questions and detailed feedback. Master Linux concepts and prepare for your exam with confidence!

The option that provides only a numeric count of the matches found is the one that uses the "-c" flag. When you use grep with this option, it suppresses the normal output of matching lines and instead displays a count of how many lines matched the pattern specified. This is particularly useful when you are only interested in knowing how many times a particular pattern occurs in a file, rather than viewing the actual lines that contain those matches.

The other options serve different purposes: some provide file names of matches, others show line numbers where matches occur, and yet others limit the number of matches displayed, but none of them would give you just the numeric count of the matches found like the "-c" option does. This makes "-c" the correct choice for retrieving a count.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy