grep

grep is a command-line utility for searching plain-text data sets for lines that match a regular expression. Its name comes from the ed command g/re/p (globally search for a regular expression and print matching lines), which has the same effect. grep was originally developed for the Unix operating system, but later available for all Unix-like systems and some others such as OS-9.

Document

grep two pattens in the same line:

grep pattenA /var/log/log.txt | grep pattenA

search directories recursively:

grep -r pattenA /var/log/log.txt | grep pattenA

--

--

Notebook for self-learning

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store