Search for a string in (all) files inside a directory
grep -r -n "THE STRING" ./*.html -A 3 -B 2
grep options:
./*.html all html in current directory
-r recursive
-i case insensitive
-n show line number
-A lines after match
-B lines before match
Written by Vic
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#