How to select several lines before search line in Linux?

Sometimes you need to look for something (i.e. grep) in file, but you want to see several lines BEFORE and AFTER the line you're looking for. So, how can you do this in Linux?
Try:

grep -B 3 -A 3 "Deploying" catalina.out

It looks for text "Deploying" in file catalina.out and returns 3 lines before (-B switch) and after (-A switch) the line with text "Deploying".

Komentarai

I always used to read article in news papers but now as I am a user of internet
so from now I am using net for articles, thanks to web.

If some one desires expert view concerning running a blog afterward i suggest him/her to visit this weblog, Keep up the good job.

Today, I went to the beach with my children. I found a sea shell and gave it to my 4 year old daughter and said "You can hear the ocean if you put this to your ear." She placed the shell to her ear and
screamed. There was a hermit crab inside and it pinched
her ear. She never wants to go back! LoL I know this is totally off topic but I had to
tell someone!

Ahaa, its fastidious discussion regarding this paragraph at this place at this website, I have read all that, so
now me also commenting here.

I think this is one of the so much significant information for me.
And i'm glad reading your article. However want to remark on few general issues, The web site style is perfect,
the articles is truly excellent : D. Good task, cheers

Hi there, after reading this amazing article i am as well glad to share my
familiarity here with mates.

Yesterday, while I was at work, my cousin stole my apple ipad and
tested to see if it can survive a 40 foot drop, just so
she can be a youtube sensation. My iPad is now broken and she has 83 views.
I know this is totally off topic but I had
to share it with someone!

If you would like to improve your familiarity just keep visiting this website
and be updated with the hottest news posted here.

Thanks for your marvelous posting! I genuinely enjoyed reading it, you
happen to be a great author.I will make sure to bookmark your blog and will
often come back later in life. I want to encourage you to ultimately continue
your great work, have a nice afternoon!

Greetings from Idaho! I'm bored at work so I decided to browse your website on my iphone during lunch break.
I really like the knowledge you provide here and can't
wait to take a look when I get home. I'm surprised at
how quick your blog loaded on my phone .. I'm not even using
WIFI, just 3G .. Anyhow, awesome site!

I savor, cause I discovered exactly what I was looking for.
You have ended my 4 day lengthy hunt! God Bless you man. Have a great day.
Bye

Excellent site you have got here.. It's hard to find excellent writing like yours nowadays.
I really appreciate people like you! Take care!!

You really make it appear really easy along with your presentation but I in finding this matter
to be really something which I feel I might by no means understand.
It kind of feels too complex and very wide for
me. I am having a look forward in your subsequent post,
I'll try to get the cling of it!

Saved as a favorite, I really like your blog!

Hi there, I enjoy reading through your article. I like to
write a little comment to support you.

Hey there, You have done a fantastic job. I'll definitely digg it and personally suggest to my friends.
I'm confident they will be benefited from this website.

I’m not that much of a internet reader to be honest but your blogs really nice, keep it up!
I'll go ahead and bookmark your website to come back in the future.

All the best

I'll right away clutch your rss feed as I can't to find your e-mail subscription link or newsletter
service. Do you have any? Please let me realize so that I may just subscribe.
Thanks.

Today, while I was at work, my cousin stole my iPad and tested to
see if it can survive a forty foot drop,
just so she can be a youtube sensation. My apple ipad
is now broken and she has 83 views. I know this is completely off topic but I had to share
it with someone!

Greate post. Keep writing such kind of info
on your blog. Im really impressed by your blog.

Hi there, You've done a fantastic job. I will certainly digg it and personally recommend to my
friends. I am confident they will be benefited from
this website.

I need to to thank you for this excellent read!!
I definitely enjoyed every bit of it. I have you saved as a favorite to look at
new stuff you post…

What i don't realize is in fact how you are now not actually a lot
more neatly-preferred than you may be right now. You are so
intelligent. You recognize thus significantly on the
subject of this subject, produced me for my part believe it
from numerous various angles. Its like women and men don't seem to
be fascinated unless it's one thing to do with
Woman gaga! Your personal stuffs nice. All the time maintain it
up!

When someone writes an paragraph he/she retains
the idea of a user in his/her mind that how a user can be aware of it.
Thus that's why this paragraph is perfect. Thanks!

What's up i am kavin, its my first occasion to commenting anyplace, when i
read this article i thought i could also make comment due to this good piece of writing.

There's definately a great deal to find out about this issue.
I really like all of the points you made.

Have you ever thought about adding a little bit more than just your articles?
I mean, what you say is important and everything.
Nevertheless think of if you added some great photos or
videos to give your posts more, "pop"! Your content is
excellent but with images and video clips, this site could definitely be one
of the best in its niche. Terrific blog!

It's remarkable to visit this web page and reading the views of all mates on the topic of this paragraph,
while I am also keen of getting know-how.

If you want to grow your experience just keep visiting
this site and be updated with the newest news update posted here.

I'm gone to tell my little brother, that he should also visit this weblog on regular
basis to get updated from most recent information.

Stunning quest there. What happened after? Take care!

Wow that was strange. I just wrote an very long
comment but after I clicked submit my comment didn't show up.
Grrrr... well I'm not writing all that over again. Anyway,
just wanted to say wonderful blog!

I am really impressed along with your writing abilities as neatly as with the structure to your blog.
Is this a paid subject matter or did you modify it yourself?
Anyway keep up the nice high quality writing,
it's uncommon to peer a nice weblog like this one today..

Tenho a mesma pensamento/opnião que você continue o
bom trabalho! http://www.autoescoladuquedecaxias.com.br

excellent submit, very informative. I wonder why the
opposite experts of this sector do not understand this.

You must continue your writing. I am sure, you have a huge readers' base already!

Excellent article. Keep posting such kind of info on your page.
Im really impressed by your blog.
Hi there, You have performed a fantastic job.
I'll certainly digg it and individually suggest to my friends.
I am sure they'll be benefited from this website.

Tenho a mesma pensamento/opnião que você continue
o bom trabalho! http://www.autoescoladuquedecaxias.com.br

I used to be recommended this web site via my cousin.
I am now not certain whether or not this post is written via him as nobody else
recognise such unique about my difficulty. You're incredible!

Thanks!

Hi there, this weekend is fastidious in favor of me, for the reason that this
occasion i am reading this great educational paragraph here
at my residence.

Greetings! Very useful advice within this post! It is the little changes
that make the largest changes. Many thanks for sharing!

Thanks for finally writing about >Komentuoti | Vampyro fermerio Ernesto blogas <Liked it!

Tenho a mesma pensamento/opnião que você continue o bom trabalho! http://www.autoescoladuquedecaxias.com.br

Quality content is the key to attract the viewers to pay
a visit the web page, that's what this site is providing.

Thanks for sharing your thoughts on programming.
Regards

Hello There. I found your blog using msn. This is a really well
written article. I will be sure to bookmark it and return to learn extra of your helpful information. Thank you for the post.
I will certainly comeback.

great put up, very informative. I ponder why the opposite experts of this sector do not understand this.
You must proceed your writing. I'm sure, you've a
great readers' base already!

Wonderful article! This is the kind of info that should be shared across the web.
Shame on Google for no longer positioning this submit higher!
Come on over and seek advice from my site .
Thanks =)

Tenho a mesma pensamento/opnião que você continue o bom trabalho! http://www.autoescoladuquedecaxias.com.br

This is the right web site for anyone who really wants to find out about
this topic. You understand a whole lot its almost tough to argue with you
(not that I personally will need to…HaHa). You
certainly put a fresh spin on a topic that's been discussed for many years.
Great stuff, just great!

After looking at a few of the blog posts on your web page, I really appreciate your technique of writing a blog.
I saved as a favorite it to my bookmark website list and will be checking back in the near future.
Take a look at my website as well and let me know what you think.

Komentuoti