{"id":861,"date":"2012-09-28T10:26:28","date_gmt":"2012-09-28T18:26:28","guid":{"rendered":"http:\/\/blog.portnumber53.com\/?p=861"},"modified":"2012-09-28T10:26:28","modified_gmt":"2012-09-28T18:26:28","slug":"bash-getting-duplicate-lines-on-both-files","status":"publish","type":"post","link":"https:\/\/blog.portnumber53.com\/index.php\/2012\/09\/28\/bash-getting-duplicate-lines-on-both-files\/","title":{"rendered":"Bash: getting duplicate lines on both files"},"content":{"rendered":"<p>Today I needed to find duplicates files from:<\/p>\n<p>&#8211; list of URLs accessed<\/p>\n<p>&#8211; list of category URLs I needed to refresh data for<\/p>\n<p>&nbsp;<\/p>\n<p>here&#39;s my code snippet:<\/p>\n<p>(This assumes LOG.txt is the file with URLs logged and CATEGORIES.txt is the list of all URLs that would pottentially need to be refreshed)<\/p>\n<p>&nbsp;<\/p>\n<blockquote>\n<p>for line in `cat CATEGORIES.txt`; do grep $line LOG.txt; done<\/p>\n<\/blockquote>\n<p>&nbsp;<\/p>\n<p>You can see it in action and output to a file by adding:<\/p>\n<blockquote>\n<p>| tee OUTPUT.txt<\/p>\n<\/blockquote>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today I needed to find duplicates files from: &#8211; list of URLs accessed &#8211; list of category URLs I needed to refresh data for &nbsp; here&#39;s my code snippet: (This assumes LOG.txt is the file with URLs logged and CATEGORIES.txt is the list of all URLs that would pottentially need&#8230; <a class=\"continue-reading-link\" href=\"https:\/\/blog.portnumber53.com\/index.php\/2012\/09\/28\/bash-getting-duplicate-lines-on-both-files\/\"> Continue reading <span class=\"meta-nav\">&rarr; <\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"class_list":["post-861","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/posts\/861","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/comments?post=861"}],"version-history":[{"count":0,"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/posts\/861\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/media?parent=861"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/categories?post=861"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/tags?post=861"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}