{"id":4569,"date":"2022-02-09T14:52:02","date_gmt":"2022-02-09T08:22:02","guid":{"rendered":"https:\/\/iatmm.com\/?p=4569"},"modified":"2022-02-09T14:58:24","modified_gmt":"2022-02-09T08:28:24","slug":"3-2-searching-and-extracting-data-from-files-2-searching-within-files-with-grep%ef%bf%bc","status":"publish","type":"post","link":"https:\/\/iat.edu.mm\/3-2-searching-and-extracting-data-from-files-2-searching-within-files-with-grep%ef%bf%bc\/","title":{"rendered":"3.2 Searching and Extracting Data from Files (2): Searching within Files with grep\ufffc"},"content":{"rendered":"\n<p class=\"has-medium-font-size\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#b41d8d\" class=\"has-inline-color\">Introduction<\/mark><\/strong><\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u101a\u1001\u102f\u1021\u1001\u1014\u103a\u1038\u1019\u103e\u102c\u1010\u1031\u102c\u1037 \u1005\u102c\u101e\u102c\u1038 Text \u1010\u103d\u1031\u1000\u102d\u102f \u1000\u102d\u102f\u1004\u103a\u1010\u103d\u101a\u103a\u1005\u102e\u1019\u1036\u101b\u102c\u1019\u103e\u102c \u1021\u101e\u102f\u1036\u1038\u1015\u103c\u102f\u101c\u1031\u1037\u101b\u103e\u102d\u1010\u1032\u1037 Tools \u1010\u103d\u1031\u1021\u1000\u103c\u1031\u102c\u1004\u103a\u1038 \u1015\u103c\u1031\u102c\u1015\u102b\u1019\u101a\u103a\u104b \u1021\u1032\u1037\u1012\u102e Tools \u1010\u103d\u1031\u1000\u102d\u102f System Administrators (\u101e\u102d\u102f\u1037) Programs \u1010\u103d\u1031\u1019\u103e \u1011\u1015\u103a\u1001\u102b\u1011\u1015\u103a\u1001\u102b \u1021\u1000\u103c\u102d\u1019\u103a\u1000\u103c\u102d\u1019\u103a\u1010\u103d\u1031\u1037\u101b\u1010\u1010\u103a\u1010\u1032\u1037 \u1021\u1001\u103b\u102d\u102f\u1037\u1021\u1001\u103b\u1000\u103a\u1021\u101c\u1000\u103a\u1010\u103d\u1031\u1000\u102d\u102f \u101b\u103e\u102c\u1016\u103d\u1031\u1016\u102d\u102f\u1037 (\u101e\u102d\u102f\u1037) \u1021\u101c\u102d\u102f\u1021\u101c\u103b\u1031\u102c\u1000\u103a\u1005\u1031\u102c\u1004\u1037\u103a\u1000\u103c\u100a\u1037\u103a\u1016\u102d\u102f\u1037\u1010\u103d\u1031\u1021\u1010\u103d\u1000\u103a \u101e\u102f\u1036\u1038\u101c\u1031\u1037\u101b\u103e\u102d\u1010\u102c\u1015\u102b\u104b<\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#b41d8d\" class=\"has-inline-color\">Searching within Files with grep<\/mark><\/strong><\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u1021\u1001\u102f\u1021\u1001\u1014\u103a\u1038\u1019\u103e\u102c \u1015\u103c\u1031\u102c\u1015\u103c\u1019\u101a\u1037\u103a \u1015\u1011\u1019\u1006\u102f\u1036\u1038 Tool \u1000\u1010\u1031\u102c\u1037 <em><mark style=\"background-color:rgba(0, 0, 0, 0);color:#b41d8d\" class=\"has-inline-color\">\u201cgrep\u201d Command<\/mark><\/em> \u1015\u102b\u104b \u201cgrep\u201d \u1006\u102d\u102f\u1010\u102c <mark style=\"background-color:rgba(0, 0, 0, 0);color:#b41d8d\" class=\"has-inline-color\"><em>\u201cGlobal Regular Expression Print\u201d<\/em> <\/mark>\u101b\u1032\u1037 \u1021\u1005\u1005\u102c\u101c\u102f\u1036\u1038 (\u1021\u1010\u102d\u102f\u1000\u1031\u102c\u1000\u103a\u1005\u102c\u101c\u102f\u1036\u1038\u1010\u103d\u1031) Abbreviation \u1010\u103d\u1031 \u1016\u103c\u1005\u103a\u1015\u103c\u102e\u1038 \u1021\u1013\u102d\u1000\u1021\u102c\u1038\u1016\u103c\u1004\u1037\u103a\u1010\u1031\u102c\u1037 \u101b\u103e\u102c\u101c\u102d\u102f\u1010\u1032\u1037 \u1005\u102c\u101e\u102c\u1038 Pattern \u1010\u103d\u1031\u1000\u102d\u102f \u1016\u102d\u102f\u1004\u103a\u1010\u103d\u1031\u1011\u1032\u1019\u103e\u102c \u101b\u103e\u102c\u1016\u103d\u1031\u1016\u102d\u102f\u1037\u1015\u102b\u1015\u1032\u104b \u101b\u103e\u102c\u1016\u103d\u1031\u101c\u102d\u102f\u1000\u103a\u1010\u1032\u1037\u1005\u102c\u101e\u102c\u1038\u1000\u102d\u102f \u1010\u103d\u1031\u1037\u101b\u103e\u102d\u1010\u1032\u1037\u1021\u1001\u102b \u1021\u1032\u1037\u1012\u102e\u1037\u1005\u102c\u101e\u102c\u1038\u1000\u102d\u102f \u1021\u1014\u102e\u101b\u1031\u102c\u1004\u103a\u1001\u103c\u101a\u103a\u1015\u103c\u102e\u1038 \u101e\u1030\u1015\u102b\u101e\u1019\u103b\u103e\u1005\u102c\u1000\u103c\u1031\u102c\u1004\u103a\u1038\u1010\u103d\u1031\u1000\u102d\u102f \u1015\u103c\u1015\u1031\u1038\u1019\u103e\u102c\u1019\u103b\u102d\u102f\u1038\u1015\u102b\u104b<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"123\" src=\"https:\/\/iatmm.com\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-09-at-14.44.54-1024x123.png\" alt=\"\" class=\"wp-image-4572\" srcset=\"https:\/\/iatmm.com\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-09-at-14.44.54-1024x123.png 1024w, https:\/\/iatmm.com\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-09-at-14.44.54-300x36.png 300w, https:\/\/iatmm.com\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-09-at-14.44.54-768x92.png 768w, https:\/\/iatmm.com\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-09-at-14.44.54-1536x185.png 1536w, https:\/\/iatmm.com\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-09-at-14.44.54-600x72.png 600w, https:\/\/iatmm.com\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-09-at-14.44.54.png 1845w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u1021\u1001\u103c\u102c\u1038\u1021\u101e\u102f\u1036\u1038\u1019\u103b\u102c\u1038\u1010\u1032\u1037 Commands \u1010\u103d\u1031\u101c\u102d\u102f\u1015\u1032<em><mark style=\"background-color:rgba(0, 0, 0, 0);color:#b41d8d\" class=\"has-inline-color\"> \u201cgrep\u201d Command<\/mark><\/em> \u1000\u102d\u102f <em><mark style=\"background-color:rgba(0, 0, 0, 0);color:#b41d8d\" class=\"has-inline-color\">Options <\/mark><\/em>\u1010\u103d\u1031 \u1010\u103d\u1032\u101e\u102f\u1036\u1038\u1014\u102d\u102f\u1004\u103a\u1015\u102b\u1010\u101a\u103a\u104b \u1021\u101e\u102f\u1036\u1038\u1021\u1019\u103b\u102c\u1038\u1006\u102f\u1036\u1038 Options \u1010\u103d\u1031\u1000\u102d\u102f \u1016\u1031\u102c\u103a\u1015\u103c\u1011\u102c\u1038\u1015\u102b\u1010\u101a\u103a\u104b<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td><strong>-i<\/strong><\/td><td><em><mark style=\"background-color:rgba(0, 0, 0, 0);color:#b41d8d\" class=\"has-inline-color\">Case Insensitive<\/mark><\/em> \u1015\u102f\u1036\u1005\u1036\u1016\u103c\u1004\u1037\u103a \u101b\u103e\u102c\u101c\u102d\u102f\u1010\u1032\u1037 \u1005\u102c\u101c\u102f\u1036\u1038\u1021\u1000\u103c\u102e\u1038\/\u1021\u101e\u1031\u1038\u1019\u101b\u103d\u1031\u1038\u1018\u1032 \u1018\u102c\u1015\u1032\u1016\u103c\u1005\u103a\u1016\u103c\u1005\u103a \u101b\u103e\u102c\u1016\u103d\u1031\u1016\u102d\u102f\u1037\u1015\u102b\u104b<\/td><\/tr><tr><td><strong>-r <\/strong><strong><\/strong><\/td><td><em><mark style=\"background-color:rgba(0, 0, 0, 0);color:#b41d8d\" class=\"has-inline-color\">Recursive<\/mark><\/em> \u1021\u1016\u103c\u1005\u103a Directory \u1014\u103e\u1004\u1037\u103a Subdirectories \u1010\u103d\u1031\u1011\u1032\u1019\u103e\u102c\u1015\u102b \u1011\u1015\u103a\u1001\u102b \u1011\u1015\u103a\u1001\u102b \u101b\u103e\u102c\u1016\u103d\u1031\u1016\u102d\u102f\u1037\u1015\u102b\u104b<\/td><\/tr><tr><td><strong>&#8211;<\/strong>c<\/td><td>\u1010\u103d\u1031\u1037\u101b\u103e\u102d\u101e\u1019\u103b\u103e\u1000\u102d\u102f \u101b\u1031\u1010\u103d\u1000\u103a\u1016\u102d\u102f\u1037 <em><mark style=\"background-color:rgba(0, 0, 0, 0);color:#b41d8d\" class=\"has-inline-color\">Count <\/mark><\/em>\u101c\u102f\u1015\u103a\u1015\u1031\u1038\u1016\u102d\u102f\u1037\u1015\u102b\u104b<\/td><\/tr><tr><td><strong>-v<\/strong><strong><\/strong><\/td><td>\u1015\u103c\u1031\u102c\u1004\u103a\u1038\u1015\u103c\u1014\u103a\u1021\u1016\u103c\u1005\u103a\u104a <em><mark style=\"background-color:rgba(0, 0, 0, 0);color:#b41d8d\" class=\"has-inline-color\">Invert<\/mark><\/em> \u1021\u1015\u103c\u1014\u103a\u1021\u101c\u103e\u1014\u103a\u1021\u1016\u103c\u1005\u103a \u1019\u1010\u103d\u1031\u1037\u1010\u1032\u1037\u1005\u102c\u1000\u103c\u1031\u102c\u1004\u103a\u1038\u1010\u103d\u1031\u1000\u102d\u102f \u1011\u102f\u1010\u103a\u1015\u103c\u1016\u102d\u102f\u1037\u1015\u102b\u104b<\/td><\/tr><tr><td>-E <\/td><td><em><mark style=\"background-color:rgba(0, 0, 0, 0);color:#b41d8d\" class=\"has-inline-color\">Extended Regular Expressions<\/mark><\/em> \u1021\u1016\u103c\u1005\u103a \u1015\u102d\u102f\u1019\u102d\u102f\u1021\u1006\u1004\u1037\u103a\u1019\u103c\u1004\u1037\u103a\u1010\u1032\u1037 \u201c|\u201d, \u201c+\u201d, \u201c?\u201d \u1005\u1010\u1032\u1037 Meta-characters \u1010\u103d\u1031\u1015\u102b \u1021\u101e\u102f\u1036\u1038\u1015\u103c\u102f\u1015\u103c\u102e\u1038 \u101b\u103e\u102c\u1016\u103d\u1031\u1016\u102d\u102f\u1037\u1015\u102b\u104b<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><em><mark style=\"background-color:rgba(0, 0, 0, 0);color:#b41d8d\" class=\"has-inline-color\">\u201cgrep\u201d Command<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-black-color\"> <\/mark><\/em>\u1019\u103e\u102c \u1021\u1001\u103c\u102c\u1038 \u1021\u101e\u102f\u1036\u1038\u101d\u1004\u103a\u1010\u1032\u1037<em><mark style=\"background-color:rgba(0, 0, 0, 0);color:#b41d8d\" class=\"has-inline-color\"> Options <\/mark><\/em>\u1019\u103b\u102c\u1038\u1005\u103d\u102c\u101b\u103e\u102d\u101e\u1031\u1038\u1010\u102c\u1019\u102d\u102f\u1037 <em><mark style=\"background-color:rgba(0, 0, 0, 0);color:#b41d8d\" class=\"has-inline-color\">Man Page <\/mark><\/em>\u1019\u103e\u102c \u1015\u102d\u102f\u1019\u102d\u102f\u101b\u103e\u102c\u1016\u103d\u1031\u101c\u1031\u1037\u101c\u102c\u1014\u102d\u102f\u1004\u103a\u1019\u103e\u102c\u1015\u102b\u104b<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/iatmm.com\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-09-at-14.53.10-1024x576.png\" alt=\"\" class=\"wp-image-4577\" srcset=\"https:\/\/iatmm.com\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-09-at-14.53.10-1024x576.png 1024w, https:\/\/iatmm.com\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-09-at-14.53.10-300x169.png 300w, https:\/\/iatmm.com\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-09-at-14.53.10-768x432.png 768w, https:\/\/iatmm.com\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-09-at-14.53.10-1536x864.png 1536w, https:\/\/iatmm.com\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-09-at-14.53.10-600x338.png 600w, https:\/\/iatmm.com\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-09-at-14.53.10.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Introduction &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u101a\u1001\u102f\u1021\u1001\u1014\u103a\u1038\u1019\u103e\u102c\u1010\u1031\u102c\u1037 \u1005\u102c\u101e\u102c\u1038 Text \u1010\u103d\u1031\u1000\u102d\u102f \u1000\u102d\u102f\u1004\u103a\u1010\u103d\u101a\u103a\u1005\u102e\u1019\u1036\u101b\u102c\u1019\u103e\u102c \u1021\u101e\u102f\u1036\u1038\u1015\u103c\u102f\u101c\u1031\u1037\u101b\u103e\u102d\u1010\u1032\u1037 Tools \u1010\u103d\u1031\u1021\u1000\u103c\u1031\u102c\u1004\u103a\u1038 \u1015\u103c\u1031\u102c\u1015\u102b\u1019\u101a\u103a\u104b \u1021\u1032\u1037\u1012\u102e Tools \u1010\u103d\u1031\u1000\u102d\u102f System Administrators (\u101e\u102d\u102f\u1037) Programs \u1010\u103d\u1031\u1019\u103e \u1011\u1015\u103a\u1001\u102b\u1011\u1015\u103a\u1001\u102b [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":4571,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[64,18,65],"tags":[],"class_list":["post-4569","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-iat-courses","category-knowledge-sharing","category-linux"],"_links":{"self":[{"href":"https:\/\/iat.edu.mm\/api\/wp\/v2\/posts\/4569","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/iat.edu.mm\/api\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/iat.edu.mm\/api\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/iat.edu.mm\/api\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/iat.edu.mm\/api\/wp\/v2\/comments?post=4569"}],"version-history":[{"count":3,"href":"https:\/\/iat.edu.mm\/api\/wp\/v2\/posts\/4569\/revisions"}],"predecessor-version":[{"id":4578,"href":"https:\/\/iat.edu.mm\/api\/wp\/v2\/posts\/4569\/revisions\/4578"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/iat.edu.mm\/api\/wp\/v2\/media\/4571"}],"wp:attachment":[{"href":"https:\/\/iat.edu.mm\/api\/wp\/v2\/media?parent=4569"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/iat.edu.mm\/api\/wp\/v2\/categories?post=4569"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/iat.edu.mm\/api\/wp\/v2\/tags?post=4569"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}