Search This Blog

Wednesday, November 10, 2010

How to search a string in a file?

 we have one file at  location ../test_unix/trial.txt.
 The context of the file[trial.txt] is given below.


 trial.txt
 ------------
 hi
 welcome to unix tutorial.
 have a nice day
 ----------------


 Now you want to serach  'have' string in the file, then
 type the below command to find it.


 grep have trial.txt


 output: have a nice day.

No comments:

Post a Comment