unix

Using grep on files with no newlines

I had a big, automatically-generated HTML file without newlines and wanted to see all occurrences of a certain image name. Using the command grep my_image.png just outputs the whole file - not useful! While writing the question to the unix section of StackExchange, I found a way to do it with grep: grep -oE ".{30}my_image.{30}" This command yielded the desired result: Each occurrence on a separate line, with 30 characters before and after.