LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices



Reply
 
Search this Thread
Old 08-11-2008, 02:48 AM   #1
B-Boy
Member
 
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, 03:02 AM   #2
matthewg42
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, 03:30 AM   #3
B-Boy
Member
 
Registered: Jan 2008
Posts: 103

Original Poster
Rep: Reputation: 15
Quote:
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
 
  


Reply


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 06:36 PM
How do you do ps ax | grep mozilla | awk '{print "kill " $1}' pppaaarrrkkk Programming 4 03-19-2008 08:17 PM
how to use grep to print just the matching expression and nothing else new_2_unix Linux - Newbie 5 01-07-2008 06:02 PM
Paragraph-option to grep TheSpork Linux - General 2 03-17-2006 02:45 AM
Force grep NOT to print file names smart_sagittari Linux - Newbie 5 04-25-2005 02:20 AM


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

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