{"id":2629,"date":"2023-07-28T23:01:19","date_gmt":"2023-07-28T23:01:19","guid":{"rendered":"https:\/\/draculaservers.com\/tutorials\/?p=2629"},"modified":"2023-07-28T23:01:19","modified_gmt":"2023-07-28T23:01:19","slug":"grep-command-in-linux-unix-explained","status":"publish","type":"post","link":"https:\/\/draculaservers.com\/tutorials\/grep-command-in-linux-unix-explained\/","title":{"rendered":"Grep Command in Linux\/Unix | Explained"},"content":{"rendered":"<div class=\"cl-preview-section\">\n<p>In the world of Linux and Unix systems, the\u00a0<code>grep<\/code>\u00a0command stands as a powerful tool for searching and filtering text. Whether you\u2019re a system administrator, developer, or an everyday user, understanding\u00a0<code>grep<\/code> its various options will empower you to efficiently locate and extract specific content from files and directories.<\/p>\n<p>In this comprehensive guide, you\u2019ll explore the ins and outs of the <code>grep<\/code>\u00a0command, its usage, practical examples, and how to harness its full potential.<\/p>\n\n<\/div>\n<div class=\"cl-preview-section\">\n<h2 id=\"what-is-grep\"><span id=\"what-is-grep-command-in-linux-and-unix\"><strong>What is Grep Command in Linux and Unix?<\/strong><\/span><\/h2>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>The name \u201cgrep\u201d is derived from the ed (Unix text editor) command \u201cg\/re\/p,\u201d which stands for \u201cglobal\/regular expression\/print.\u201d Grep is a command-line utility that searches for patterns in text files and outputs lines containing the specified pattern. It employs regular expressions (regex) to define search patterns, making it an incredibly flexible and versatile tool for text manipulation.<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<h2 id=\"basic-syntax\"><span id=\"basic-syntax-of-grep-command\"><strong>Basic Syntax of Grep Command<\/strong><\/span><\/h2>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>The basic syntax of the\u00a0<code>grep<\/code>\u00a0command is as follows:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<pre class=\" language-bash\"><code class=\"prism language-bash\"><span class=\"token function\">grep<\/span> <span class=\"token punctuation\">[<\/span>options<span class=\"token punctuation\">]<\/span> pattern <span class=\"token punctuation\">[<\/span>file<span class=\"token punctuation\">..<\/span>.<span class=\"token punctuation\">]<\/span>\r\n<\/code><\/pre>\n<\/div>\n<div class=\"cl-preview-section\">\n<ul>\n<li><code>pattern<\/code>: The text pattern you want to search for. It can be a simple string or a regular expression.<\/li>\n<li><code>file...<\/code>: (Optional) The name of one or more files to search. If no file is specified,\u00a0<code>grep<\/code>\u00a0reads from standard input (stdin).<\/li>\n<\/ul>\n<\/div>\n<div class=\"cl-preview-section\">\n<h2 id=\"searching-in-a-single-file\"><strong>Searching in a Single File<\/strong><\/h2>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>Let\u2019s start with a straightforward example of searching for a specific word in a single file:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<pre class=\" language-bash\"><code class=\"prism language-bash\"><span class=\"token function\">grep<\/span> <span class=\"token string\">\"apple\"<\/span> fruits.txt\r\n<\/code><\/pre>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>In this example,\u00a0<code>grep<\/code>\u00a0searches for the word \u201capple\u201d in the\u00a0<code>fruits.txt<\/code>\u00a0file and displays the lines containing the word.<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<h2 id=\"searching-in-multiple-files\"><strong>Searching in Multiple Files<\/strong><\/h2>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>You can also search for a pattern in multiple files simultaneously:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<pre class=\" language-bash\"><code class=\"prism language-bash\"><span class=\"token function\">grep<\/span> <span class=\"token string\">\"apple\"<\/span> fruits.txt vegetables.txt\r\n<\/code><\/pre>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>In this case,\u00a0<code>grep<\/code>\u00a0searches for \u201capple\u201d in both\u00a0<code>fruits.txt<\/code>\u00a0and\u00a0<code>vegetables.txt<\/code>\u00a0files and outputs the matching lines.<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<h2 id=\"case-insensitive-search\"><strong>Case-Insensitive Search<\/strong><\/h2>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>By default,\u00a0<code>grep<\/code>\u00a0performs a case-sensitive search. To perform a case-insensitive search, use the\u00a0<code>-i<\/code>\u00a0option:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<pre class=\" language-bash\"><code class=\"prism language-bash\"><span class=\"token function\">grep<\/span> -i <span class=\"token string\">\"apple\"<\/span> fruits.txt\r\n<\/code><\/pre>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>With the\u00a0<code>-i<\/code>\u00a0option,\u00a0<code>grep<\/code>\u00a0matches \u201capple,\u201d \u201cApple,\u201d \u201cAPPLE,\u201d and any other case variation of the word.<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<h2 id=\"searching-recursively\"><strong>Searching Recursively<\/strong><\/h2>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>The\u00a0<code>-r<\/code>\u00a0(or\u00a0<code>--recursive<\/code>) option enables recursive searching in directories. It is useful when you want to search for a pattern in all files within a directory and its subdirectories:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<pre class=\" language-bash\"><code class=\"prism language-bash\"><span class=\"token function\">grep<\/span> -r <span class=\"token string\">\"apple\"<\/span> \/path\/to\/directory\r\n<\/code><\/pre>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>This command searches for \u201capple\u201d in all files located in\u00a0<code>\/path\/to\/directory<\/code>\u00a0and its subdirectories.<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<h2 id=\"counting-matches\"><strong>Counting Matches<\/strong><\/h2>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>To count the number of matches for a pattern, use the\u00a0<code>-c<\/code>\u00a0(or\u00a0<code>--count<\/code>) option:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<pre class=\" language-bash\"><code class=\"prism language-bash\"><span class=\"token function\">grep<\/span> -c <span class=\"token string\">\"apple\"<\/span> fruits.txt\r\n<\/code><\/pre>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>The output will be the total count of occurrences of \u201capple\u201d in the\u00a0<code>fruits.txt<\/code>\u00a0file.<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<h2 id=\"displaying-line-numbers\"><strong>Displaying Line Numbers<\/strong><\/h2>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>To display line numbers along with the matching lines, use the\u00a0<code>-n<\/code>\u00a0(or\u00a0<code>--line-number<\/code>) option:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<pre class=\" language-bash\"><code class=\"prism language-bash\"><span class=\"token function\">grep<\/span> -n <span class=\"token string\">\"apple\"<\/span> fruits.txt\r\n<\/code><\/pre>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>The output will show the line numbers of the matching lines in addition to the lines themselves.<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<h2 id=\"inverse-negative-match\"><strong>Inverse (Negative) Match<\/strong><\/h2>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>To invert the match and display lines that do not contain the specified pattern, use the\u00a0<code>-v<\/code>\u00a0(or\u00a0<code>--invert-match<\/code>) option:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<pre class=\" language-bash\"><code class=\"prism language-bash\"><span class=\"token function\">grep<\/span> -v <span class=\"token string\">\"apple\"<\/span> fruits.txt\r\n<\/code><\/pre>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>This will display all lines in\u00a0<code>fruits.txt<\/code>\u00a0that do not contain the word \u201capple.\u201d<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<h2 id=\"regular-expressions-with-grep\"><strong>Regular Expressions with Grep<\/strong><\/h2>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>One of the most powerful features of\u00a0<code>grep<\/code>\u00a0is its ability to work with regular expressions. Regular expressions allow you to define complex search patterns. For example, to search for lines containing words that start with \u201capp,\u201d you can use the following regular expression:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<pre class=\" language-bash\"><code class=\"prism language-bash\"><span class=\"token function\">grep<\/span> -E <span class=\"token string\">\"\\bapp\\w+\"<\/span> fruits.txt\r\n<\/code><\/pre>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>Here,\u00a0<code>\\b<\/code>\u00a0denotes a word boundary, and\u00a0<code>\\w+<\/code>\u00a0matches one or more word characters (letters, digits, or underscores).<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<h2 id=\"matching-whole-words-only\"><strong>Matching Whole Words Only<\/strong><\/h2>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>To search for whole words only and avoid partial matches, use the\u00a0<code>-w<\/code>\u00a0(or\u00a0<code>--word-regexp<\/code>) option:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<pre class=\" language-bash\"><code class=\"prism language-bash\"><span class=\"token function\">grep<\/span> -w <span class=\"token string\">\"apple\"<\/span> fruits.txt\r\n<\/code><\/pre>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>This command will match \u201capple\u201d as a whole word but not as part of another word (e.g., \u201cpineapple\u201d).<\/p>\n<h2 id=\"draculaservers-kvm-vps-hosting\">DraculaServers&#8217; KVM VPS Hosting!<\/h2>\n<p>Take control of your online presence with DraculaServers&#8217; KVM VPS Hosting. Our cutting-edge technology gives you the freedom to customize every aspect of your virtual server environment, ensuring a hosting experience that&#8217;s uniquely yours. Experience lightning-fast speeds, scalable resources, and an intuitive control panel\u2014all at competitive pricing.<\/p>\n<p>Don&#8217;t miss out! Visit Dracula Server\u2019s KVM today and discover the hosting plans to empower your online journey.<\/p>\n<p><a href=\"https:\/\/draculaservers.com\/kvm.php\" target=\"_blank\" rel=\"noopener\">Ready to take charge? Check out our KVM Hosting Plans Here!<\/a><\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<h2 id=\"using-grep-with-pipes\"><strong>Using Grep with Pipes<\/strong><\/h2>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>One of the strengths of\u00a0<code>grep<\/code>\u00a0is its ability to work seamlessly with other commands using pipes. For instance, you can combine\u00a0<code>grep<\/code>\u00a0with\u00a0<code>ls<\/code>\u00a0to filter files based on their names:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<pre class=\" language-bash\"><code class=\"prism language-bash\"><span class=\"token function\">ls<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> <span class=\"token string\">\".txt\"<\/span>\r\n<\/code><\/pre>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>This command lists files in the current directory and pipes the output to\u00a0<code>grep<\/code>, which filters and displays only the files with the \u201c.txt\u201d extension.<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<h2 id=\"using-grep-with-find\"><strong>Using Grep with Find<\/strong><\/h2>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>You can also use\u00a0<code>grep<\/code>\u00a0with\u00a0<code>find<\/code>\u00a0to search for specific files within a directory hierarchy:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<pre class=\" language-bash\"><code class=\"prism language-bash\"><span class=\"token function\">find<\/span> \/path\/to\/directory -type f -name <span class=\"token string\">\"*.txt\"<\/span> -exec <span class=\"token function\">grep<\/span> <span class=\"token string\">\"apple\"<\/span> <span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">}<\/span> +\r\n<\/code><\/pre>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>This command uses\u00a0<code>find<\/code>\u00a0to locate all\u00a0<code>.txt<\/code>\u00a0files in the specified directory and then executes\u00a0<code>grep<\/code>\u00a0on them, searching for the word \u201capple.\u201d<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<h2 id=\"grep-with-regular-expressions-advanced-example\"><strong>Grep with Regular Expressions: Advanced Example<\/strong><\/h2>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>Suppose you have a log file that contains entries in the following format:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<pre><code>[2022-01-01 10:30:45] User: Alice performed action: login\r\n[2022-01-01 11:20:15] User: Bob performed action: logout\r\n<\/code><\/pre>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>You want to extract all login activities from the log. You can use the following\u00a0<code>grep<\/code>\u00a0command with a regular expression:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<pre class=\" language-bash\"><code class=\"prism language-bash\"><span class=\"token function\">grep<\/span> <span class=\"token string\">\"\\blogin\\b\"<\/span> log.txt\r\n<\/code><\/pre>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>This will display all lines containing the word \u201clogin\u201d as a whole word.<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<h2 id=\"conclusion\"><strong>Conclusion<\/strong><\/h2>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>The\u00a0<code>grep<\/code>\u00a0command in Linux\/Unix is an essential tool for text pattern matching and filtering. With its ability to work with regular expressions and its various options,\u00a0<code>grep<\/code>\u00a0provides a powerful and flexible way to search and manipulate text. From simple searches in individual files to recursive searches across directories,\u00a0<code>grep<\/code> can efficiently handle a wide range of text-processing tasks. By mastering\u00a0<code>grep<\/code>\u00a0and combining it with other commands using pipes, you can become a proficient text detective in the command-line world.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In the world of Linux and Unix systems, the\u00a0grep\u00a0command stands as a powerful tool for searching and filtering text. Whether you\u2019re a system administrator, developer, or an everyday user, understanding\u00a0grep its various options will empower you to efficiently locate and extract specific content from files and directories. In this comprehensive guide, you\u2019ll explore the ins [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":2632,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,61],"tags":[165,102,111,143,166],"class_list":["post-2629","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux-basics","category-linux-commands","tag-grep","tag-linux","tag-linux-tutorials","tag-unix","tag-unix-tutorial"],"blocksy_meta":[],"featured_image_urls_v2":{"full":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/07\/What.png",1280,720,false],"thumbnail":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/07\/What-150x150.png",150,150,true],"medium":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/07\/What-300x169.png",300,169,true],"medium_large":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/07\/What-768x432.png",768,432,true],"large":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/07\/What-1024x576.png",1024,576,true],"1536x1536":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/07\/What.png",1280,720,false],"2048x2048":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/07\/What.png",1280,720,false],"pk-small":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/07\/What-80x80.png",80,80,true],"pk-thumbnail":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/07\/What-300x225.png",300,225,true]},"post_excerpt_stackable_v2":"<p>In the world of Linux and Unix systems, the\u00a0grep\u00a0command stands as a powerful tool for searching and filtering text. Whether you\u2019re a system administrator, developer, or an everyday user, understanding\u00a0grep its various options will empower you to efficiently locate and extract specific content from files and directories. In this comprehensive guide, you\u2019ll explore the ins and outs of the grep\u00a0command, its usage, practical examples, and how to harness its full potential. What is Grep Command in Linux and Unix? The name \u201cgrep\u201d is derived from the ed (Unix text editor) command \u201cg\/re\/p,\u201d which stands for \u201cglobal\/regular expression\/print.\u201d Grep is a&hellip;<\/p>\n","category_list_v2":"<a href=\"https:\/\/draculaservers.com\/tutorials\/category\/linux-basics\/\" rel=\"category tag\">Linux Basics<\/a>, <a href=\"https:\/\/draculaservers.com\/tutorials\/category\/linux-commands\/\" rel=\"category tag\">Linux Commands<\/a>","author_info_v2":{"name":"Abdul Mannan","url":"https:\/\/draculaservers.com\/tutorials\/author\/abdul-mannan-tbgmail-com\/"},"comments_num_v2":"0 comments","yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Grep Command in Linux\/Unix | Explained - Dracula Servers Tutorials<\/title>\n<meta name=\"description\" content=\"The\u00a0grep\u00a0command in Linux\/Unix is an essential tool for text pattern matching and filtering that allows search and text manipulation.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/draculaservers.com\/tutorials\/grep-command-in-linux-unix-explained\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Grep Command in Linux\/Unix | Explained - Dracula Servers Tutorials\" \/>\n<meta property=\"og:description\" content=\"The\u00a0grep\u00a0command in Linux\/Unix is an essential tool for text pattern matching and filtering that allows search and text manipulation.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/draculaservers.com\/tutorials\/grep-command-in-linux-unix-explained\/\" \/>\n<meta property=\"og:site_name\" content=\"Dracula Servers Tutorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-28T23:01:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/07\/What.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Abdul Mannan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Abdul Mannan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/grep-command-in-linux-unix-explained\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/grep-command-in-linux-unix-explained\\\/\"},\"author\":{\"name\":\"Abdul Mannan\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/ac89d0281f4fb596bfaa0bc1e746c8a6\"},\"headline\":\"Grep Command in Linux\\\/Unix | Explained\",\"datePublished\":\"2023-07-28T23:01:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/grep-command-in-linux-unix-explained\\\/\"},\"wordCount\":860,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/grep-command-in-linux-unix-explained\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/What.png\",\"keywords\":[\"grep\",\"linux\",\"Linux Tutorials\",\"Unix\",\"Unix Tutorial\"],\"articleSection\":[\"Linux Basics\",\"Linux Commands\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/grep-command-in-linux-unix-explained\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/grep-command-in-linux-unix-explained\\\/\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/grep-command-in-linux-unix-explained\\\/\",\"name\":\"Grep Command in Linux\\\/Unix | Explained - Dracula Servers Tutorials\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/grep-command-in-linux-unix-explained\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/grep-command-in-linux-unix-explained\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/What.png\",\"datePublished\":\"2023-07-28T23:01:19+00:00\",\"description\":\"The\u00a0grep\u00a0command in Linux\\\/Unix is an essential tool for text pattern matching and filtering that allows search and text manipulation.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/grep-command-in-linux-unix-explained\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/grep-command-in-linux-unix-explained\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/grep-command-in-linux-unix-explained\\\/#primaryimage\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/What.png\",\"contentUrl\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/What.png\",\"width\":1280,\"height\":720},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/grep-command-in-linux-unix-explained\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Grep Command in Linux\\\/Unix | Explained\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#website\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/\",\"name\":\"Dracula Servers Tutorials\",\"description\":\"Dedicated Servers\",\"publisher\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#organization\",\"name\":\"Dracula Servers\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2016\\\/06\\\/dracula_full_logo_smaller.png\",\"contentUrl\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2016\\\/06\\\/dracula_full_logo_smaller.png\",\"width\":1625,\"height\":200,\"caption\":\"Dracula Servers\"},\"image\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/ac89d0281f4fb596bfaa0bc1e746c8a6\",\"name\":\"Abdul Mannan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2809442d44177cab4f90e1d9b3295560462063881ca1374b6d597d8f0b48fc21?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2809442d44177cab4f90e1d9b3295560462063881ca1374b6d597d8f0b48fc21?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2809442d44177cab4f90e1d9b3295560462063881ca1374b6d597d8f0b48fc21?s=96&d=mm&r=g\",\"caption\":\"Abdul Mannan\"},\"description\":\"An individual trying to decipher the enigmas of technology by the sheer driving force of curiosity. Interested in learning new skills and being better at those skills than the lot.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Grep Command in Linux\/Unix | Explained - Dracula Servers Tutorials","description":"The\u00a0grep\u00a0command in Linux\/Unix is an essential tool for text pattern matching and filtering that allows search and text manipulation.","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:\/\/draculaservers.com\/tutorials\/grep-command-in-linux-unix-explained\/","og_locale":"en_US","og_type":"article","og_title":"Grep Command in Linux\/Unix | Explained - Dracula Servers Tutorials","og_description":"The\u00a0grep\u00a0command in Linux\/Unix is an essential tool for text pattern matching and filtering that allows search and text manipulation.","og_url":"https:\/\/draculaservers.com\/tutorials\/grep-command-in-linux-unix-explained\/","og_site_name":"Dracula Servers Tutorials","article_published_time":"2023-07-28T23:01:19+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/07\/What.png","type":"image\/png"}],"author":"Abdul Mannan","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Abdul Mannan","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/draculaservers.com\/tutorials\/grep-command-in-linux-unix-explained\/#article","isPartOf":{"@id":"https:\/\/draculaservers.com\/tutorials\/grep-command-in-linux-unix-explained\/"},"author":{"name":"Abdul Mannan","@id":"https:\/\/draculaservers.com\/tutorials\/#\/schema\/person\/ac89d0281f4fb596bfaa0bc1e746c8a6"},"headline":"Grep Command in Linux\/Unix | Explained","datePublished":"2023-07-28T23:01:19+00:00","mainEntityOfPage":{"@id":"https:\/\/draculaservers.com\/tutorials\/grep-command-in-linux-unix-explained\/"},"wordCount":860,"commentCount":0,"publisher":{"@id":"https:\/\/draculaservers.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/draculaservers.com\/tutorials\/grep-command-in-linux-unix-explained\/#primaryimage"},"thumbnailUrl":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/07\/What.png","keywords":["grep","linux","Linux Tutorials","Unix","Unix Tutorial"],"articleSection":["Linux Basics","Linux Commands"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/draculaservers.com\/tutorials\/grep-command-in-linux-unix-explained\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/draculaservers.com\/tutorials\/grep-command-in-linux-unix-explained\/","url":"https:\/\/draculaservers.com\/tutorials\/grep-command-in-linux-unix-explained\/","name":"Grep Command in Linux\/Unix | Explained - Dracula Servers Tutorials","isPartOf":{"@id":"https:\/\/draculaservers.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/draculaservers.com\/tutorials\/grep-command-in-linux-unix-explained\/#primaryimage"},"image":{"@id":"https:\/\/draculaservers.com\/tutorials\/grep-command-in-linux-unix-explained\/#primaryimage"},"thumbnailUrl":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/07\/What.png","datePublished":"2023-07-28T23:01:19+00:00","description":"The\u00a0grep\u00a0command in Linux\/Unix is an essential tool for text pattern matching and filtering that allows search and text manipulation.","breadcrumb":{"@id":"https:\/\/draculaservers.com\/tutorials\/grep-command-in-linux-unix-explained\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/draculaservers.com\/tutorials\/grep-command-in-linux-unix-explained\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/draculaservers.com\/tutorials\/grep-command-in-linux-unix-explained\/#primaryimage","url":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/07\/What.png","contentUrl":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/07\/What.png","width":1280,"height":720},{"@type":"BreadcrumbList","@id":"https:\/\/draculaservers.com\/tutorials\/grep-command-in-linux-unix-explained\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/draculaservers.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Grep Command in Linux\/Unix | Explained"}]},{"@type":"WebSite","@id":"https:\/\/draculaservers.com\/tutorials\/#website","url":"https:\/\/draculaservers.com\/tutorials\/","name":"Dracula Servers Tutorials","description":"Dedicated Servers","publisher":{"@id":"https:\/\/draculaservers.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/draculaservers.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/draculaservers.com\/tutorials\/#organization","name":"Dracula Servers","url":"https:\/\/draculaservers.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/draculaservers.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2016\/06\/dracula_full_logo_smaller.png","contentUrl":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2016\/06\/dracula_full_logo_smaller.png","width":1625,"height":200,"caption":"Dracula Servers"},"image":{"@id":"https:\/\/draculaservers.com\/tutorials\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/draculaservers.com\/tutorials\/#\/schema\/person\/ac89d0281f4fb596bfaa0bc1e746c8a6","name":"Abdul Mannan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/2809442d44177cab4f90e1d9b3295560462063881ca1374b6d597d8f0b48fc21?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/2809442d44177cab4f90e1d9b3295560462063881ca1374b6d597d8f0b48fc21?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2809442d44177cab4f90e1d9b3295560462063881ca1374b6d597d8f0b48fc21?s=96&d=mm&r=g","caption":"Abdul Mannan"},"description":"An individual trying to decipher the enigmas of technology by the sheer driving force of curiosity. Interested in learning new skills and being better at those skills than the lot."}]}},"_links":{"self":[{"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/posts\/2629","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/comments?post=2629"}],"version-history":[{"count":2,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/posts\/2629\/revisions"}],"predecessor-version":[{"id":2631,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/posts\/2629\/revisions\/2631"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/media\/2632"}],"wp:attachment":[{"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/media?parent=2629"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/categories?post=2629"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/tags?post=2629"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}