{"id":361,"date":"2012-04-30T14:04:31","date_gmt":"2012-04-30T14:04:31","guid":{"rendered":"http:\/\/www.plugged.in\/?p=361"},"modified":"2012-04-30T14:04:31","modified_gmt":"2012-04-30T14:04:31","slug":"how-to-grep-compressed-files-over-ssh","status":"publish","type":"post","link":"https:\/\/www.veriteknik.net.tr\/en\/how-to-grep-compressed-files-over-ssh\/","title":{"rendered":"How to grep Compressed Files?"},"content":{"rendered":"<p>Sometimes you need to search the contents of .gz files in your system. Unfortunately, grep doesn&#8217;t work on compressed files. To overcome this, people usually advise to first\u00a0 uncompress the file(s), and then grep your text, after that finally re-compress your file(s)&#8230;<\/p>\n<p>You don&#8217;t need to uncompress them in the first place. You can use <strong>zgrep<\/strong> on compressed or gzipped files.<\/p>\n<p><!--more--><\/p>\n<p>To search in compressed file, execute the command :<br \/>\n<strong>root@ck [~]#zgrep &#8216;put-your-text-here&#8217; \/your-file-path-here\/file.gz<\/strong><br \/>\nExample : I want to grep &#8216;plugged&#8217; in all of my exim_paniclog archived files.<br \/>\n<strong>root@ck [~]# zgrep &#8216;plugged&#8217; \/var\/log\/exim_paniclog.*<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes you need to search the contents of .gz files in your system. Unfortunately, grep doesn&#8217;t work on compressed files. To overcome this, people usually advise to first\u00a0 uncompress the file(s), and then grep your text, after that finally re-compress your file(s)&#8230; You don&#8217;t need to uncompress them in the first place. You can use [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","footnotes":""},"categories":[370,372],"tags":[484,485,486,487,488,489,490],"yst_prominent_words":[1844,1846,711,1843,1849,1848,1575,1845,1847],"class_list":["post-361","post","type-post","status-publish","format-standard","hentry","category-linux","category-linux_help","tag-bzgrep","tag-compressed","tag-grep","tag-grep-compressed-file","tag-inside","tag-tar","tag-zgrep"],"jetpack_featured_media_url":"","uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"Cevdet Kaymaz","author_link":"https:\/\/www.veriteknik.net.tr\/en\/author\/cevdet-kaymaz\/"},"uagb_comment_info":0,"uagb_excerpt":"Sometimes you need to search the contents of .gz files in your system. Unfortunately, grep doesn&#8217;t work on compressed files. To overcome this, people usually advise to first\u00a0 uncompress the file(s), and then grep your text, after that finally re-compress your file(s)&#8230; You don&#8217;t need to uncompress them in the first place. You can use&hellip;","_links":{"self":[{"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/posts\/361","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/comments?post=361"}],"version-history":[{"count":0,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/posts\/361\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/media?parent=361"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/categories?post=361"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/tags?post=361"},{"taxonomy":"yst_prominent_words","embeddable":true,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/yst_prominent_words?post=361"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}