grep for a few lines

September 15th, 2006 mysurface Posted in grep, Text Manipulation | Hits: 15959 | 3 Comments »

One of the useful option for grep, when you find the keyword you are searching, instead of return a particular line that contains the keyword, it allows you to specified how many lines to return by specified -A option.

Let say I want to return 5 lines when i found “main” at hello.c.

grep -A 5 main hello.c

3 Responses to “grep for a few lines”

  1. Usually I do not post on blogs, but I want to say that this write-up very forced me to do so! Thanks, extremely nice article.

  2. Imagine moving in to a whole new environment, millions of miles away only to
    find out you left something or several packages are lost
    in transit. Choosing between different providers can be challenging and most of the time daunting due to comparison issues one should face when selecting providers.
    Training you have completed as an employee or completed elsewhere will not satisfy the education requirements to become a licensed asbestos removal contractor.

    Finally, it is important to remember that
    the country that you want to relocate to may have local laws and regulations
    that will apply in your case and it is best to choose a company that has experience of this.

    By following the above mentioned tips, you can take the stress out of the whole process of shifting.

  3. Asking questions are in fact nice thing if
    you are not understanding something fully, except this article offers pleasant understanding even.

Leave a Reply