unix grep and tail

tail -n5000 xyz.log

above shows last 5000 lines right


if i want to see all the 15723 lines of xyz.log what command i have to give

tail -n5000 xyz.log|grep 'ERROR WS'
how to make above case sensitive search like
tail -n5000 xyz.log|grep 'error ws'
how to make above whole word search? so that i wont see below as result ERROR aaa WS etc


please advise
LVL 7
gudii9Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Seth SimmonsSr. Systems AdministratorCommented:
above shows last 5000 lines right

yes

if i want to see all the 15723 lines of xyz.log what command i have to give

cat xyz.log

how to make above case sensitive search

grep is already case-sensitive by default; you would use -i with grep to ignore case

so that i wont see below as result ERROR aaa WS etc

if you put 'error ws' it will search for that phrase as-is
it will not return something with anything in between those words
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dfkeCommented:
Hi,

actually use double quotes ".

grep -i "error ws" xyz.log

Open in new window


Cheers
1
skullnobrainsCommented:
recommend : accept ID: 42519838

reason : double quotes won't make a difference and actually make it run slower by enabling expansion and escaping with an additional error risk
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.