You've been given a task to find all occurrences of the word "error" in a directory containing numerous log files. Which command would you primarily use for this search?

  • grep
  • find
  • sed
  • awk
To find all occurrences of the word "error" in a directory with log files, you would primarily use the grep command. grep is a powerful tool for searching text and regular expressions in files and can be used to quickly locate specific content, like error messages, within files.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *