

{"id":328,"date":"2026-06-21T22:58:47","date_gmt":"2026-06-21T22:58:47","guid":{"rendered":"https:\/\/apropostechsolutionscorp.ca\/blog\/?p=328"},"modified":"2026-06-21T22:58:47","modified_gmt":"2026-06-21T22:58:47","slug":"linux-grep-part0","status":"publish","type":"post","link":"https:\/\/apropostechsolutionscorp.ca\/blog\/2026\/06\/21\/linux-grep-part0\/","title":{"rendered":"Linux: grep, part0"},"content":{"rendered":"\n<h3>The grep command is a Linux shell one for finding strings.<\/h3>\n<p>\nThe following is by my understanding.<\/p>\n<p>\nThe grep command is used to find a string and will print out each line that contains it.<\/p>\n<p>\ngrep &#8220;log&#8221; a-file.txt<\/p>\n<p>\nwill print, to terminal, each line from a-file.txt that contains the string &#8220;log&#8221;.<\/p>\n<p>\ngrep log a-file.txt<\/p>\n<p>\nseems to work the same as if &#8220;log&#8221; is in quotes.<\/p>\n<p>\nThe grep command can be used with regular expressions. For example,<\/p>\n<p>\ngrep -E gre&#8221;e|a&#8221;t a-file.txt<\/p>\n<p>\nwill find &#8220;great&#8221; or &#8220;greet&#8221; in a-file.txt. The -E switch means you don&#8217;t need to escape the | operator.<\/p>\n<p>\nSource:<\/p>\n<p><a href=\"https:\/\/linux.die.net\/man\/1\/grep\">linux.die.net<\/a><\/p>\n<p><a href=\"https:\/\/apropostechsolutionscorp.ca\">-JS<\/a><\/p> \n\n\n","protected":false},"excerpt":{"rendered":"<p>The grep command is a Linux shell one for finding strings. The following is by my understanding. The grep command is used to find a string and will print out each line that contains it. grep &#8220;log&#8221; a-file.txt will print, to terminal, each line from a-file.txt that contains the string &#8220;log&#8221;. grep log a-file.txt seems [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[89],"tags":[92,100],"class_list":["post-328","post","type-post","status-publish","format-standard","hentry","category-linux","tag-grep","tag-regular-expressions"],"_links":{"self":[{"href":"https:\/\/apropostechsolutionscorp.ca\/blog\/wp-json\/wp\/v2\/posts\/328","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/apropostechsolutionscorp.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/apropostechsolutionscorp.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/apropostechsolutionscorp.ca\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/apropostechsolutionscorp.ca\/blog\/wp-json\/wp\/v2\/comments?post=328"}],"version-history":[{"count":5,"href":"https:\/\/apropostechsolutionscorp.ca\/blog\/wp-json\/wp\/v2\/posts\/328\/revisions"}],"predecessor-version":[{"id":333,"href":"https:\/\/apropostechsolutionscorp.ca\/blog\/wp-json\/wp\/v2\/posts\/328\/revisions\/333"}],"wp:attachment":[{"href":"https:\/\/apropostechsolutionscorp.ca\/blog\/wp-json\/wp\/v2\/media?parent=328"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/apropostechsolutionscorp.ca\/blog\/wp-json\/wp\/v2\/categories?post=328"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/apropostechsolutionscorp.ca\/blog\/wp-json\/wp\/v2\/tags?post=328"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}