Wednesday, 2 October 2013

How do I print the number of lines in which a string appears 2 or more times using unix grep and regular expressions?

How do I print the number of lines in which a string appears 2 or more
times using unix grep and regular expressions?

I need to search one .txt file and this is only if a word appears twice in
one line. So if I had the phrase: "I fed my cat today and my cat was
happy" it would return 1, but only if that word appeared twice in that
same line. I need a line count of this for the entire file. I am using the
program putty to do this in unix.

No comments:

Post a Comment