I have a file with this content: dskldfsd.com
domain domain.com sub.domain.com domain.main.com anythinghere
I want to delete the line which contains the word
domain. Using grep, this command find the exact line I want:
grep -w '^domain$' test.txt
But I want to delete this line that contains
domain as a single word from the beginning to the end of the line. I want to keep the lines where the word
domain is just part of the string.