{"id":91,"date":"2024-12-16T08:02:22","date_gmt":"2024-12-16T08:02:22","guid":{"rendered":"https:\/\/techkubo.com\/linux\/?p=91"},"modified":"2025-05-28T17:54:46","modified_gmt":"2025-05-28T17:54:46","slug":"linux-grep-command","status":"publish","type":"post","link":"https:\/\/techkubo.com\/linux\/linux-grep-command\/","title":{"rendered":"Linux &#8211; grep Command"},"content":{"rendered":"\n<p>The <code>grep<\/code> command stands for &#8220;global regular expression print.&#8221; It is used to search for specific patterns within files or output. The patterns can be simple strings or complex regular expressions. <code>grep<\/code> is a powerful tool for finding and filtering text.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Initial Example<\/h2>\n\n\n\n<p>Using <code>grep<\/code> to search for the string &#8220;example&#8221; in a file called <code>file.txt<\/code>:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;htmlmixed&quot;,&quot;mime&quot;:&quot;text\/html&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;UNIX&quot;,&quot;language&quot;:&quot;HTML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;html&quot;}\">grep &quot;example&quot; file.txt<\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">GREP Parameters<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Parameter<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>-i, --ignore-case<\/code><\/td><td>Perform a case-insensitive search, ignoring letter case differences<\/td><\/tr><tr><td><code>-v, --invert-match<\/code><\/td><td>Invert the search results to display lines that do not match the pattern<\/td><\/tr><tr><td><code>-r, --recursive<\/code><\/td><td>Recursively search through directories and their subdirectories<\/td><\/tr><tr><td><code>-w, --word-regexp<\/code><\/td><td>Match only whole words that exactly match the pattern<\/td><\/tr><tr><td><code>-x, --line-regexp<\/code><\/td><td>Match only lines that exactly match the entire pattern<\/td><\/tr><tr><td><code>-c, --count<\/code><\/td><td>Count the number of lines that match the pattern<\/td><\/tr><tr><td><code>-n, --line-number<\/code><\/td><td>Display the line numbers along with the matching lines<\/td><\/tr><tr><td><code>-l, --files-with-matches<\/code><\/td><td>List the files that contain at least one match<\/td><\/tr><tr><td><code>-L, --files-without-match<\/code><\/td><td>List the files that do not contain any matches<\/td><\/tr><tr><td><code>-H, --with-filename<\/code><\/td><td>Display the filename for each match<\/td><\/tr><tr><td><code>-h, --no-filename<\/code><\/td><td>Suppress the filename in the output when searching multiple files<\/td><\/tr><tr><td><code>-o, --only-matching<\/code><\/td><td>Show only the matching part of the lines, not the entire line<\/td><\/tr><tr><td><code>-q, --quiet<\/code><\/td><td>Suppress all normal output and exit immediately after finding the first match<\/td><\/tr><tr><td><code>-s, --no-messages<\/code><\/td><td>Suppress error messages about nonexistent or unreadable files<\/td><\/tr><tr><td><code>--color[=WHEN]<\/code><\/td><td>Highlight matching strings with color. WHEN can be <code>always<\/code>, <code>never<\/code>, or <code>auto<\/code><\/td><\/tr><tr><td><code>-E, --extended-regexp<\/code><\/td><td>Interpret patterns as extended regular expressions<\/td><\/tr><tr><td><code>-F, --fixed-strings<\/code><\/td><td>Interpret patterns as fixed strings, not regular expressions<\/td><\/tr><tr><td><code>-P, --perl-regexp<\/code><\/td><td>Interpret patterns as Perl-compatible regular expressions<\/td><\/tr><tr><td><code>--binary-files=TYPE<\/code><\/td><td>Specify how to handle binary files. TYPE can be <code>binary<\/code>, <code>text<\/code>, or <code>without-match<\/code><\/td><\/tr><tr><td><code>--include=GLOB<\/code><\/td><td>Search only files that match the given glob pattern<\/td><\/tr><tr><td><code>--exclude=GLOB<\/code><\/td><td>Skip files and directories matching the given glob pattern<\/td><\/tr><tr><td><code>--version<\/code><\/td><td>Display version information and exit<\/td><\/tr><tr><td><code>--help<\/code><\/td><td>Show help information and exit<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Examples<\/h2>\n\n\n\n<h4 class=\"wp-block-heading\">1. Search for a Pattern in a File<\/h4>\n\n\n\n<p>To search for a specific string in a file:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;htmlmixed&quot;,&quot;mime&quot;:&quot;text\/html&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;UNIX&quot;,&quot;language&quot;:&quot;HTML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;html&quot;}\">grep &quot;pattern&quot; filename.txt<\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">2. Search for a Pattern in Multiple Files<\/h4>\n\n\n\n<p>To search for a specific string in multiple files:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;htmlmixed&quot;,&quot;mime&quot;:&quot;text\/html&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;UNIX&quot;,&quot;language&quot;:&quot;HTML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;html&quot;}\">grep &quot;pattern&quot; file1.txt file2.txt<\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">3. Ignore Case Sensitivity<\/h4>\n\n\n\n<p>To perform a case-insensitive search, use the <code>-i<\/code> option:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;htmlmixed&quot;,&quot;mime&quot;:&quot;text\/html&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;UNIX&quot;,&quot;language&quot;:&quot;HTML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;html&quot;}\">grep -i &quot;pattern&quot; filename.txt<\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">4. Display Line Numbers<\/h4>\n\n\n\n<p>To display line numbers along with the matched lines, use the <code>-n<\/code> option:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;htmlmixed&quot;,&quot;mime&quot;:&quot;text\/html&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;UNIX&quot;,&quot;language&quot;:&quot;HTML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;html&quot;}\">grep -n &quot;pattern&quot; filename.txt<\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">5. Recursive Search<\/h4>\n\n\n\n<p>To search for a pattern in all files within a directory and its subdirectories, use the <code>-r<\/code> (recursive) option:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;htmlmixed&quot;,&quot;mime&quot;:&quot;text\/html&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;UNIX&quot;,&quot;language&quot;:&quot;HTML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;html&quot;}\">grep -r &quot;pattern&quot; directory_name\/<\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">6. Invert Match<\/h4>\n\n\n\n<p>To display lines that do not match the pattern, use the <code>-v<\/code> option:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;htmlmixed&quot;,&quot;mime&quot;:&quot;text\/html&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;UNIX&quot;,&quot;language&quot;:&quot;HTML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;html&quot;}\">grep -v &quot;pattern&quot; filename.txt<\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">7. Search for Whole Words<\/h4>\n\n\n\n<p>To match only whole words, use the <code>-w<\/code> option:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;htmlmixed&quot;,&quot;mime&quot;:&quot;text\/html&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;UNIX&quot;,&quot;language&quot;:&quot;HTML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;html&quot;}\">grep -w &quot;pattern&quot; filename.txt<\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">8. Use Regular Expressions<\/h4>\n\n\n\n<p>To use extended regular expressions, use the <code>-E<\/code> option:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;htmlmixed&quot;,&quot;mime&quot;:&quot;text\/html&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;UNIX&quot;,&quot;language&quot;:&quot;HTML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;html&quot;}\">grep -E &quot;regular_expression&quot; filename.txt<\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">9. Count Matches<\/h4>\n\n\n\n<p>To count the number of matching lines, use the <code>-c<\/code> option:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;htmlmixed&quot;,&quot;mime&quot;:&quot;text\/html&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;UNIX&quot;,&quot;language&quot;:&quot;HTML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;html&quot;}\">grep -c &quot;pattern&quot; filename.txt<\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Linux Playground<\/h2>\n\n\n\n<iframe src=\"https:\/\/techkubo.com\/playcloud-linux-static.html\" title=\"Try Linux on TechKubo\" width=\"100%\" height=\"500\"><\/iframe>\n","protected":false},"excerpt":{"rendered":"<p>The grep command stands for &#8220;global regular expression print.&#8221; It is used to search for specific patterns within files or [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[],"class_list":["post-91","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Linux - grep Command - Linux Command Tutorial<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/techkubo.com\/linux\/linux-grep-command\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Linux - grep Command - Linux Command Tutorial\" \/>\n<meta property=\"og:description\" content=\"The grep command stands for &#8220;global regular expression print.&#8221; It is used to search for specific patterns within files or [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techkubo.com\/linux\/linux-grep-command\/\" \/>\n<meta property=\"og:site_name\" content=\"Linux Command Tutorial\" \/>\n<meta property=\"article:published_time\" content=\"2024-12-16T08:02:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-05-28T17:54:46+00:00\" \/>\n<meta name=\"author\" content=\"Manong\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Manong\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/techkubo.com\/linux\/linux-grep-command\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/techkubo.com\/linux\/linux-grep-command\/\"},\"author\":{\"name\":\"Manong\",\"@id\":\"https:\/\/techkubo.com\/linux\/#\/schema\/person\/b4fa2f01fa4ff2a4e98276ce47115965\"},\"headline\":\"Linux &#8211; grep Command\",\"datePublished\":\"2024-12-16T08:02:22+00:00\",\"dateModified\":\"2025-05-28T17:54:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/techkubo.com\/linux\/linux-grep-command\/\"},\"wordCount\":387,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/techkubo.com\/linux\/#organization\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/techkubo.com\/linux\/linux-grep-command\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/techkubo.com\/linux\/linux-grep-command\/\",\"url\":\"https:\/\/techkubo.com\/linux\/linux-grep-command\/\",\"name\":\"Linux - grep Command - Linux Command Tutorial\",\"isPartOf\":{\"@id\":\"https:\/\/techkubo.com\/linux\/#website\"},\"datePublished\":\"2024-12-16T08:02:22+00:00\",\"dateModified\":\"2025-05-28T17:54:46+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/techkubo.com\/linux\/linux-grep-command\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/techkubo.com\/linux\/linux-grep-command\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/techkubo.com\/linux\/linux-grep-command\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/techkubo.com\/linux\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Linux &#8211; grep Command\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/techkubo.com\/linux\/#website\",\"url\":\"https:\/\/techkubo.com\/linux\/\",\"name\":\"Linux Command Tutorial\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/techkubo.com\/linux\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/techkubo.com\/linux\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/techkubo.com\/linux\/#organization\",\"name\":\"Linux Command Tutorial\",\"url\":\"https:\/\/techkubo.com\/linux\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/techkubo.com\/linux\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/techkubo.com\/linux\/wp-content\/uploads\/sites\/8\/2025\/01\/cropped-Techkubo-logo-1.png\",\"contentUrl\":\"https:\/\/techkubo.com\/linux\/wp-content\/uploads\/sites\/8\/2025\/01\/cropped-Techkubo-logo-1.png\",\"width\":1617,\"height\":1184,\"caption\":\"Linux Command Tutorial\"},\"image\":{\"@id\":\"https:\/\/techkubo.com\/linux\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/techkubo.com\/linux\/#\/schema\/person\/b4fa2f01fa4ff2a4e98276ce47115965\",\"name\":\"Manong\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/techkubo.com\/linux\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/21a7455736c21887b8fefe0935012d65?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/21a7455736c21887b8fefe0935012d65?s=96&d=mm&r=g\",\"caption\":\"Manong\"},\"sameAs\":[\"https:\/\/techkubo.com\"],\"url\":\"https:\/\/techkubo.com\/linux\/author\/manong\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Linux - grep Command - Linux Command Tutorial","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/techkubo.com\/linux\/linux-grep-command\/","og_locale":"en_US","og_type":"article","og_title":"Linux - grep Command - Linux Command Tutorial","og_description":"The grep command stands for &#8220;global regular expression print.&#8221; It is used to search for specific patterns within files or [&hellip;]","og_url":"https:\/\/techkubo.com\/linux\/linux-grep-command\/","og_site_name":"Linux Command Tutorial","article_published_time":"2024-12-16T08:02:22+00:00","article_modified_time":"2025-05-28T17:54:46+00:00","author":"Manong","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Manong","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techkubo.com\/linux\/linux-grep-command\/#article","isPartOf":{"@id":"https:\/\/techkubo.com\/linux\/linux-grep-command\/"},"author":{"name":"Manong","@id":"https:\/\/techkubo.com\/linux\/#\/schema\/person\/b4fa2f01fa4ff2a4e98276ce47115965"},"headline":"Linux &#8211; grep Command","datePublished":"2024-12-16T08:02:22+00:00","dateModified":"2025-05-28T17:54:46+00:00","mainEntityOfPage":{"@id":"https:\/\/techkubo.com\/linux\/linux-grep-command\/"},"wordCount":387,"commentCount":0,"publisher":{"@id":"https:\/\/techkubo.com\/linux\/#organization"},"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techkubo.com\/linux\/linux-grep-command\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techkubo.com\/linux\/linux-grep-command\/","url":"https:\/\/techkubo.com\/linux\/linux-grep-command\/","name":"Linux - grep Command - Linux Command Tutorial","isPartOf":{"@id":"https:\/\/techkubo.com\/linux\/#website"},"datePublished":"2024-12-16T08:02:22+00:00","dateModified":"2025-05-28T17:54:46+00:00","breadcrumb":{"@id":"https:\/\/techkubo.com\/linux\/linux-grep-command\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techkubo.com\/linux\/linux-grep-command\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/techkubo.com\/linux\/linux-grep-command\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techkubo.com\/linux\/"},{"@type":"ListItem","position":2,"name":"Linux &#8211; grep Command"}]},{"@type":"WebSite","@id":"https:\/\/techkubo.com\/linux\/#website","url":"https:\/\/techkubo.com\/linux\/","name":"Linux Command Tutorial","description":"","publisher":{"@id":"https:\/\/techkubo.com\/linux\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/techkubo.com\/linux\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/techkubo.com\/linux\/#organization","name":"Linux Command Tutorial","url":"https:\/\/techkubo.com\/linux\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techkubo.com\/linux\/#\/schema\/logo\/image\/","url":"https:\/\/techkubo.com\/linux\/wp-content\/uploads\/sites\/8\/2025\/01\/cropped-Techkubo-logo-1.png","contentUrl":"https:\/\/techkubo.com\/linux\/wp-content\/uploads\/sites\/8\/2025\/01\/cropped-Techkubo-logo-1.png","width":1617,"height":1184,"caption":"Linux Command Tutorial"},"image":{"@id":"https:\/\/techkubo.com\/linux\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/techkubo.com\/linux\/#\/schema\/person\/b4fa2f01fa4ff2a4e98276ce47115965","name":"Manong","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techkubo.com\/linux\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/21a7455736c21887b8fefe0935012d65?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/21a7455736c21887b8fefe0935012d65?s=96&d=mm&r=g","caption":"Manong"},"sameAs":["https:\/\/techkubo.com"],"url":"https:\/\/techkubo.com\/linux\/author\/manong\/"}]}},"_links":{"self":[{"href":"https:\/\/techkubo.com\/linux\/wp-json\/wp\/v2\/posts\/91"}],"collection":[{"href":"https:\/\/techkubo.com\/linux\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techkubo.com\/linux\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techkubo.com\/linux\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techkubo.com\/linux\/wp-json\/wp\/v2\/comments?post=91"}],"version-history":[{"count":3,"href":"https:\/\/techkubo.com\/linux\/wp-json\/wp\/v2\/posts\/91\/revisions"}],"predecessor-version":[{"id":274,"href":"https:\/\/techkubo.com\/linux\/wp-json\/wp\/v2\/posts\/91\/revisions\/274"}],"wp:attachment":[{"href":"https:\/\/techkubo.com\/linux\/wp-json\/wp\/v2\/media?parent=91"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techkubo.com\/linux\/wp-json\/wp\/v2\/categories?post=91"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techkubo.com\/linux\/wp-json\/wp\/v2\/tags?post=91"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}