til

#TIL : Grep : find a string in folder

I learned on 2017-09-05 about grep, sysadmin

Grep is a greate tool for searching a string in files.

Syntax

$ grep -nr '[string]' [folder]

If you want to show surrounding lines the result, add flag -C [number] to the command

$ grep -nr -C 3 'hello' src

Enjoyed this?

Leave a kudo — it means a lot.

0