I have a big sql dump with long lines and I would like to use grep to find a certain text string.
grep text_string filename.sql
returns the result lines which are huge and difficult to see where my text_string appears. What I want to achieve is to get a result that contains lets say 50 characters to the left and 50 to the right of the search term (text_string). Is this possible?
text_string
. Should begrep -Eo '.{0,50}text_string.{0,50}' filename.sql
instead. – cas Apr 19 '16 at 11:18