- List item
abcd_Server1 CCDDomain defg_Server1 GGFDomain kdkhs_Server1 CCDDomain abce_Server1 CCDDomain dgdg_Server1 CCADomain dfdkhs_Server1 GGFDomain
I need to search for the word "Domain" and then count the unique occurrences of the word.
In above case the output should be 3 since 3 different names are there (
I have tried using this :
grep -oh '*Domain' "ServerNames.txt" | sort -u | wc -l
('-oh' I got from another answer)