The grep manual says "By default, grep prints the matching lines.". What does this matching lines says. When I tried its prints the whole paragraph containing the pattern.
1 Answer
if you are using vi, and you are on the line you are looking for, moving one line down using your cursor keys, if you are jumping too much, it means that your paragraph contains more than one line on the terminal.
grep -n . filename
will show you all the lines preceded by a line number and colon sign (:) so you can differentiate between lines in the sense of text editor vs lines in the sense of screen real estate.
for grep, a line is delimited by a new line character, not by 80 characters that you see on a standard terminal window.
if you are running a putty terminal or any other xterm (as in gnome's terminal), stretch your terminal size to a larger one and you will see the lines realign themselves.
\n
) until the end of the paragraph...