Text ProcessingLesson 17Free preview
Bash Search Text (grep)
This lesson is part of Bash · All levels
Summary
The grep command searches for lines containing specific patterns in the file or from the input pipe. It supports important options such as -i to ignore capital letters, -n to line numbers, and -r to recursive search. The pattern is considered regex, so mark the quotation so that the specific character is not misinterpreted shell.
Key points
- Grep file patterns showing matching lines
- I ignore the capitalization, -n display the line number
- R looking for recursive across the subdirectory
- v displays an unmatched line
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.