bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: grep command


From: Tony Abou-Assaleh
Subject: Re: grep command
Date: Thu, 30 Aug 2007 18:43:02 -0300 (ADT)

> I hope you can help me with my problem. I got up to this point point -
> C:\grepsb80\grep32.exe "search word" C:\grepsb80\myfile.txt >
> C:\grepsb80\result.txt , what do i need to add if i want to get 3 lines from
> the top and 3 lines from the bottom of my keyword ?

$ grep --help
...
Context control:
  -B, --before-context=NUM  print NUM lines of leading context
  -A, --after-context=NUM   print NUM lines of trailing context
  -C, --context=NUM         print NUM lines of output context
  -NUM                      same as --context=NUM
...

The manual pages (man grep) have a more detailed description of all of
grep's options.

Cheers,

TAA

-----------------------------------------------------
Tony Abou-Assaleh
Email:    address@hidden
Web site: http://tony.abou-assaleh.net
----------------------[THE END]----------------------





reply via email to

[Prev in Thread] Current Thread [Next in Thread]