Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] print grep results to file



>>>>> "CM" == Charles Muller <acmuller@example.com> writes:

    CM> I want to search a directory of files, retrieve the lines that
    CM> contain "<hdwd>" and print them to a file. I tried to do it
    CM> with this:

    CM> dell@[chuck] # grep "<hdwd>" *.xml -print > /home/chuck/headwords.txt

    CM> ...but I am missing something. I googled around a bit to try
    CM> to find some sort of example for this, but so far, no
    CM> luck. Any suggestions?

If you omit -print it will work; if you don't want the file names
printed in front of each matched line, add -h.

Cheers

P.S. deja vu... (or is it a glitch in the matrix?)

http://www.tlug.jp/ML/0301/msg00317.html
(see the messages in the thread)

-- 
Viktor


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links