TopicLinux →
Simple definition
A command used to search for text corresponding to a pattern.
Technical definition
grep runs through files or streams and can use regular expressions, recursivity and filters.
What is it used for ?
Quickly find an error or information in the logs.
Practical example
grep -i error /var/log/application.log searches for rows containing error without taking into account the breakage.
Common issues
- too broad a expression
- Binnapped by mistake
- Incomplete result without recursivity
Related terms
Key takeaway: Exact behavior and commands may vary depending on versions, products and architectures.