{"id":1748,"date":"2013-10-18T09:37:51","date_gmt":"2013-10-18T09:37:51","guid":{"rendered":"http:\/\/blog.designed79.co.uk\/?p=1748"},"modified":"2013-10-18T09:38:14","modified_gmt":"2013-10-18T09:38:14","slug":"1748","status":"publish","type":"post","link":"https:\/\/blog.designed79.co.uk\/?p=1748","title":{"rendered":"GREP multi words"},"content":{"rendered":"<p>The grep command supports regular expression pattern. To search multiple words, use following syntax:<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\">grep 'word1\\|word2\\|word3' \/path\/to\/file<\/div><\/div>\n<p>In this example, search warning, error, and critical words in a text log file called \/var\/log\/messages, enter:<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\">grep 'warning\\|error\\|critical' \/var\/log\/messages<\/div><\/div>\n<p>To just match words, add -w with:<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\">grep -w 'warning\\|error\\|critical' \/var\/log\/messages<\/div><\/div>\n<p>egrep command can skip the above syntax and use the following syntax:<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\">egrep -w 'warning|error|critical' \/var\/log\/messages<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>The grep command supports regular expression pattern. To search multiple words, use following syntax: grep &#8216;word1\\|word2\\|word3&#8217; \/path\/to\/file In this example, search warning, [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1748","post","type-post","status-publish","format-standard","hentry","category-info-on-tech"],"_links":{"self":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1748","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1748"}],"version-history":[{"count":0,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1748\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1748"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1748"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1748"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}