LinuxAnswers - the LQ Linux tutorial section.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 08-11-2008, 01:48 AM   #1
Registered: Jan 2008
Posts: 103

Rep: Reputation: 15
grep and print paragraph

Hi how can I grep for a work but print the entire paragraph?
Old 08-11-2008, 02:02 AM   #2
Senior Member
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
With the GNU implementation of grep you can use the options -A -B and -C.
Old 08-11-2008, 02:30 AM   #3
Registered: Jan 2008
Posts: 103

Original Poster
Rep: Reputation: 15
Originally Posted by matthewg42 View Post
With the GNU implementation of grep you can use the options -A -B and -C.
thanks -C worked for me


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Find/grep command to find matching files, print filename, then print matching content stefanlasiewski Programming 8 12-18-2013 05:36 PM
How do you do ps ax | grep mozilla | awk '{print "kill " $1}' pppaaarrrkkk Programming 4 03-19-2008 07:17 PM
how to use grep to print just the matching expression and nothing else new_2_unix Linux - Newbie 5 01-07-2008 05:02 PM
Paragraph-option to grep TheSpork Linux - General 2 03-17-2006 01:45 AM
Force grep NOT to print file names smart_sagittari Linux - Newbie 5 04-25-2005 01:20 AM

All times are GMT -5. The time now is 03:42 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration