Terme informatique

grep

A command used to search for text corresponding to a pattern.

View my favorites

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

journalctl · Bash

Key takeaway: Exact behavior and commands may vary depending on versions, products and architectures.

♡ 0