Unix grep command

I am trying to grep "create order-line" from /home/base/source/order*.* then output the grep result to a file "grepr.txt" in the current directory. Is it possible to do so?

I know how to use the grep command but I have no idea how to direct the output to a file. Could anyone help.

Thanks.
 

benji00

New Member
something like...

cd <directory>
find . -name "order*.*" -print | xargs grep -i "create order-line" > ./grepr.txt

the grep -i ignores case (I hope).
 
Thanks so much. Actually the following worked perfectly for me,

$ cd /home/base/source/
$ grep -l -i "create order-line" order*.* > /usr/kennyaround/output.txt
 
Top