Write the commands to display all of the lines in file networkProposal that begain wit hte string in "in the world. WINDOWS has many"

Wouldn't it be something like this

grep “in the world. WINDOWS has many” -n networkProposal

this is the Windows operating
system.  And in the opinion 
of many,  one of the best

in the world.  WINDOWS has many 
capabilities that an enterprize requires.

It will even clean your windows.
Will wonders ever cease.

Open in new window

Member_2_4942450Asked:
Who is Participating?
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.

TintinCommented:
Lots of assignment questions being posted at the moment.

Use the ^ symbol to specify the beginning of the line

For example if file.txt has

The dog and the cat.
the cat is grey

grep "the cat" file.txt

would match both lines, whereas

grep "^the cat" file.txt

would only match the line beginning with "the cat".
jonmchanCommented:
For your exact example, the code would be:

grep "^in the world.  WINDOWS has many" -n networkProposal

I notice though, you have 2 spaces between "world." and "WINDOWS" which could make you return no results if the spaces change. To account for that, use the *[[:space:]] to select all strings no matter how many or how few whitespaces exist between world. and WINDOWS.

grep "^in the world.*[[:space:]]WINDOWS has many" -n networkProposal

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
Member_2_4942450Author Commented:
good
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
System Programming

From novice to tech pro — start learning today.