A Linux system administrator needs to scan through the contents of multiple log files in the `/var/log` directory to locate lines containing the string "AUTHENTICATION_FAILURE". Which command-line tool is specifically designed to search file contents for matching text patterns?
- grepAnswer
- Bfind
- Ccat
- Dls
Answer
grep
The grep command searches text files or command output for matching lines using strings or regular expressions. It is the primary tool for searching text within files in Linux and macOS environments.
Step-by-Step Solution
Key Concept
Linux command-line utilities for file and text searching