How can I grep out a particular line from a file in a folder.

Basically I have a folder /my/cool/folder/myfile.txt

I know it has line: I am cool lkasjdfaksldfj

How can I grep on that file so the line starting with I am cool .... shows on the terminal?

link|improve this question
feedback

2 Answers

up vote 7 down vote accepted
$ grep "^I am cool lkasjdfaksldfj" /my/cool/folder/myfile.txt

Also:

$ man grep

It'll do ya good.

link|improve this answer
feedback

also

$ cat myfile | grep mytext

in order to output to the terminal

link|improve this answer
3  
Useless use of cat. – Teddy Mar 26 '10 at 8:41
Why limit yourself to a single process when you can use two?!?! ;) – ErikA Mar 26 '10 at 14:02
feedback

Your Answer

 
or
required, but never shown