Quantcast
Channel: Active questions tagged bash+awk - Ask Ubuntu
Viewing all articles
Browse latest Browse all 102

Compare two files, remove line

$
0
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?


Viewing all articles
Browse latest Browse all 102

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>