0

I have one file with URL's.
Example urls.txt:

https://www.indeed.co.uk/cmp/Endsleigh-Insurance/reviews?fcountry=ALL&fjobtitle=Claims+Assistant<br>
https://www.thestudentroom.co.uk/showthread.php?t=1063045

Have a second file with domain names only.
Example domains.txt:

remid.de
octc-china.com
crystalprod.cz
gesoc.org.mx
springbreakdirect.com
daytoncondohunters.com
automaxgroup.me

Is there any way to compare the files and remove urls that have same domain name from the second file
Like if urls.txt contain URL with any of domains from domains.txt remove it and save file.
I can do it with sed line by line but it will take quite a while..
Is ther any way to do it with grep or awk one command?

1

found my own answer:

grep -F -vf domains.txt urls.txt

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.