GK Question

technology medium mcq

Which Linux command is used to search for a specific string within files?

  1. find
  2. grep
  3. locate
  4. search

Answer: grep

grep (global regular expression print) searches files for lines matching a pattern/string. Supports regex, recursive search, and context display. find locates files by name/path; locate uses a database; search is not a standard command. Essential for log analysis and text processing in system administration.

Topic Operating Systems
Exam Relevance SSC JE, Railway JE, Banking IT