I want to find and list lines in text file that contain only two words that are four characters or more.
I can find words of four characters or more with:
grep '[A-Za-z][A-Za-z][A-Za-z][A-Za-z][A-Za-z]*' file.txt
but how can I limit output to show only lines with two such words?
Any hints (not necessarily an answer)?
thanks
UPDATE: Thank you. After following your advice I'm now with:
egrep '([A-Za-z]){4,}' file.txt
That lists all the lines with highlighted words that are 4+ letters long. Now I have only to filter it to show only the lines where such words (4+ letters long) occur twice. Any hints?