{"id":28283,"date":"2018-09-25T01:55:35","date_gmt":"2018-09-25T06:55:35","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=28283"},"modified":"2023-04-05T02:11:06","modified_gmt":"2023-04-05T07:11:06","slug":"linux-grep-guide-for-advanced-users","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/linux-grep-guide-for-advanced-users\/","title":{"rendered":"Linux Grep Guide for Advanced Users"},"content":{"rendered":"<div id=\"bsf_rt_marker\"><\/div><p><img decoding=\"async\" class=\"alignnone size-full wp-image-28289\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/Linux-Grep-Guide-for-Advanced-Users.jpg\" alt=\"Linux Grep Guide for Advanced Users\" width=\"742\" height=\"372\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/Linux-Grep-Guide-for-Advanced-Users.jpg 742w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/Linux-Grep-Guide-for-Advanced-Users-150x75.jpg 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/Linux-Grep-Guide-for-Advanced-Users-300x150.jpg 300w\" sizes=\"(max-width: 742px) 100vw, 742px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Anyone who&#8217;s administered a Linux server for a certain amount of time is familiar with the &#8220;grep&#8221; command. With Linux&#8217;s philosophy of &#8220;Everything is a file&#8221;, grep becomes crucial to traversing log files, configuration files, checking for certain errors in output files, and getting the number of matches. In this tutorial, I&#8217;ll show you a few advanced uses of grep that can still be pretty useful. These are not hard to find in the man pages, but they&#8217;re just an extension of grep&#8217;s default functionality.<\/span><!--more--><\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69c8968f1f42f\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69c8968f1f42f\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.rosehosting.com\/blog\/linux-grep-guide-for-advanced-users\/#Searching-for-Multiple-Words-at-the-Same-Time\" >Searching for Multiple Words at the Same Time<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.rosehosting.com\/blog\/linux-grep-guide-for-advanced-users\/#Searching-an-Entire-Directory-for-a-Match-and-Showing-the-File-Name\" >Searching an Entire Directory for a Match and Showing the File Name<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.rosehosting.com\/blog\/linux-grep-guide-for-advanced-users\/#Counting-the-Number-of-Matching-Lines\" >Counting the Number of Matching Lines<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Searching-for-Multiple-Words-at-the-Same-Time\"><\/span><span style=\"font-weight: 400;\">Searching for Multiple Words at the Same Time<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Normally, the usage for grep goes something like this:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">grep <\/span><i><span style=\"font-weight: 400;\">'pattern'<\/span><\/i><span style=\"font-weight: 400;\"> filename<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">Where &#8216;pattern&#8217; is any given pattern or regular expression to match. However, let&#8217;s say you have an error log file and are performing routine maintenance. You want to check the log files for the existence of some keywords that span a variety of sources. Normally, you&#8217;d have to use a separate grep expression for each of these phrases.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">However, we can use regular expressions easily with the &#8220;-E&#8221; parameter. To start with, we have a file called &#8220;animal-count&#8221; with the following contents:<\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-28284\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/grep-pattern-filename.jpg\" alt=\"grep pattern filename\" width=\"600\" height=\"271\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/grep-pattern-filename.jpg 600w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/grep-pattern-filename-150x68.jpg 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/grep-pattern-filename-300x136.jpg 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Let&#8217;s say we want to search this file for these two phrases:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">sparrow<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">dogs<\/span><\/p>\n<p><span style=\"font-weight: 400;\">We can use the following grep expression:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">grep -Ew 'sparrow|dogs' animal-count<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">There are two flags:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">-E means that we&#8217;re using extended regular expressions<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">-w means that we only want to match whole words<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">To make it even easier, we can just replace &#8220;grep -E&#8221; with &#8220;egrep&#8221;. So the above command becomes:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">egrep -w 'sparrow|dogs' animal-count<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">And here&#8217;s the output:<\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-28285\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/egrep-w-count.jpg\" alt=\"egrep -w -count\" width=\"600\" height=\"242\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/egrep-w-count.jpg 600w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/egrep-w-count-150x61.jpg 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/egrep-w-count-300x121.jpg 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">We can match as many words as we need to that way. If you want to remove the &#8220;words&#8221; requirement and instead just want a straight up string match, then you can drop the &#8220;w&#8221; parameter.<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Searching-an-Entire-Directory-for-a-Match-and-Showing-the-File-Name\"><\/span><span style=\"font-weight: 400;\">Searching an Entire Directory for a Match and Showing the File Name<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">We normally think of grep searching either a file or a specific output from another command. However, we can also use it to search an entire <\/span><i><span style=\"font-weight: 400;\">directory<\/span><\/i><span style=\"font-weight: 400;\"> of files at the same time.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Let&#8217;s say for example, that you have a bunch of log files scattered all around the system. After all, many packages have their own locations for log files. To make things easy for you, you create a new folder containing symbolic links to all the various log files that are of interest to you.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Now you can search all of them together with grep using the &#8220;-R&#8221; command. The capital &#8220;R&#8221; tells grep to include symbolic links. The small &#8220;r&#8221; ignores symbolic links not found on the command line by default.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">For example, in the following example, we search the current directory for a string:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">grep -r sparrow .<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">The dot (.) at the end indicates the current directory. We get the following output:<\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-28286\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/grep-r.jpg\" alt=\"grep -r\" width=\"600\" height=\"204\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/grep-r.jpg 600w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/grep-r-150x51.jpg 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/grep-r-300x102.jpg 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">You can see below, that it searches recursively as well with another pattern match:<\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-28287\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/Recursive-file-searching-with-grep-r.jpg\" alt=\"Recursive file searching with grep -r \" width=\"600\" height=\"202\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/Recursive-file-searching-with-grep-r.jpg 600w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/Recursive-file-searching-with-grep-r-150x51.jpg 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/Recursive-file-searching-with-grep-r-300x101.jpg 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">This is very useful for searching a bunch of files at the same time. The output also shows you the name of the file containing the matching strings! I personally like this solution with &#8220;-R&#8221; for searching through a set of symbolic links at once, to save time.<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Counting-the-Number-of-Matching-Lines\"><\/span><span style=\"font-weight: 400;\">Counting the Number of Matching Lines<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Sometimes you want to know <\/span><i><span style=\"font-weight: 400;\">how many<\/span><\/i><span style=\"font-weight: 400;\"> times a certain keyword has appeared in grep. For example, if you&#8217;re searching the website files for a certain spider, you want a count of the number of lines containing a specific user agent.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">To do that, we simply add in the &#8220;-c&#8221; parameter. Keep in mind that this removes the regular output of grep and it will no longer show you individual matches. For example, without the &#8220;-c&#8221; parameter:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">grep rr animal-count<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">We get a simple list of occurrences. With &#8220;-c&#8221; however:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">grep -c rr animal-count<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">And we get a count of the number of lines:<\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-28288\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/grep-command-counting-the-number-of-matching-lines.jpg\" alt=\"grep command counting the number of matching lines\" width=\"600\" height=\"200\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/grep-command-counting-the-number-of-matching-lines.jpg 600w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/grep-command-counting-the-number-of-matching-lines-150x50.jpg 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/grep-command-counting-the-number-of-matching-lines-300x100.jpg 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">As you can see, it no longer displays each occurrence.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Grep is an extremely powerful tool, and its functionality has only increased over the years. We can create complicated regular expressions, and even create an expression to format the output of a file to make it easier to read. These examples of advanced grep usage will give you a taste of what&#8217;s possible, and will hopefully encourage you to delve into the manual yourself!<\/span><\/p>\n<hr \/>\n<p>If you are one of our <a href=\"https:\/\/www.rosehosting.com\">fully managed web hosting<\/a> customers, you don&#8217;t have to come up with complex grep commands yourself, you can simply ask our system administrators to help you with grep commands. They are available 24\/7 and will take care of your request immediately.<\/p>\n<p>If you liked this post on advanced grep commands, please share it with your friends via social media networks. If you have any questions regarding this tutorial, please write a comment below. Thanks!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Anyone who&#8217;s administered a Linux server for a certain amount of time is familiar with the &#8220;grep&#8221; command. With Linux&#8217;s &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Linux Grep Guide for Advanced Users\" class=\"read-more button\" href=\"https:\/\/www.rosehosting.com\/blog\/linux-grep-guide-for-advanced-users\/#more-28283\" aria-label=\"Read more about Linux Grep Guide for Advanced Users\">Read More<\/a><\/p>\n","protected":false},"author":4,"featured_media":28289,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1236,2071],"tags":[1751,1750,27],"class_list":["post-28283","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-guides","category-linux","tag-advanced-grep-command","tag-grep-command","tag-linux","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Linux Grep Guide for Advanced Users | RoseHosting<\/title>\n<meta name=\"description\" content=\"Linux Grep Guide for Advanced Users | RoseHosting\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.rosehosting.com\/blog\/linux-grep-guide-for-advanced-users\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Linux Grep Guide for Advanced Users\" \/>\n<meta property=\"og:description\" content=\"Linux Grep Guide for Advanced Users | RoseHosting\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.rosehosting.com\/blog\/linux-grep-guide-for-advanced-users\/\" \/>\n<meta property=\"og:site_name\" content=\"RoseHosting\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/RoseHosting\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/rosehosting.helpdesk\" \/>\n<meta property=\"article:published_time\" content=\"2018-09-25T06:55:35+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-04-05T07:11:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/Linux-Grep-Guide-for-Advanced-Users.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"742\" \/>\n\t<meta property=\"og:image:height\" content=\"372\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Jeff Wilson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:site\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeff Wilson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.rosehosting.com\/blog\/linux-grep-guide-for-advanced-users\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.rosehosting.com\/blog\/linux-grep-guide-for-advanced-users\/\"},\"author\":{\"name\":\"Jeff Wilson\",\"@id\":\"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713\"},\"headline\":\"Linux Grep Guide for Advanced Users\",\"datePublished\":\"2018-09-25T06:55:35+00:00\",\"dateModified\":\"2023-04-05T07:11:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.rosehosting.com\/blog\/linux-grep-guide-for-advanced-users\/\"},\"wordCount\":787,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.rosehosting.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.rosehosting.com\/blog\/linux-grep-guide-for-advanced-users\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/Linux-Grep-Guide-for-Advanced-Users.jpg\",\"keywords\":[\"advanced grep command\",\"grep command\",\"Linux\"],\"articleSection\":[\"Guides\",\"Linux\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.rosehosting.com\/blog\/linux-grep-guide-for-advanced-users\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.rosehosting.com\/blog\/linux-grep-guide-for-advanced-users\/\",\"url\":\"https:\/\/www.rosehosting.com\/blog\/linux-grep-guide-for-advanced-users\/\",\"name\":\"Linux Grep Guide for Advanced Users | RoseHosting\",\"isPartOf\":{\"@id\":\"https:\/\/www.rosehosting.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.rosehosting.com\/blog\/linux-grep-guide-for-advanced-users\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.rosehosting.com\/blog\/linux-grep-guide-for-advanced-users\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/Linux-Grep-Guide-for-Advanced-Users.jpg\",\"datePublished\":\"2018-09-25T06:55:35+00:00\",\"dateModified\":\"2023-04-05T07:11:06+00:00\",\"description\":\"Linux Grep Guide for Advanced Users | RoseHosting\",\"breadcrumb\":{\"@id\":\"https:\/\/www.rosehosting.com\/blog\/linux-grep-guide-for-advanced-users\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.rosehosting.com\/blog\/linux-grep-guide-for-advanced-users\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.rosehosting.com\/blog\/linux-grep-guide-for-advanced-users\/#primaryimage\",\"url\":\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/Linux-Grep-Guide-for-Advanced-Users.jpg\",\"contentUrl\":\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/Linux-Grep-Guide-for-Advanced-Users.jpg\",\"width\":742,\"height\":372,\"caption\":\"Linux Grep Guide for Advanced Users\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.rosehosting.com\/blog\/linux-grep-guide-for-advanced-users\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.rosehosting.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Linux Grep Guide for Advanced Users\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.rosehosting.com\/blog\/#website\",\"url\":\"https:\/\/www.rosehosting.com\/blog\/\",\"name\":\"RoseHosting.com\",\"description\":\"Premium Linux Tutorials Since 2001\",\"publisher\":{\"@id\":\"https:\/\/www.rosehosting.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.rosehosting.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.rosehosting.com\/blog\/#organization\",\"name\":\"RoseHosting\",\"url\":\"https:\/\/www.rosehosting.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png\",\"contentUrl\":\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png\",\"width\":192,\"height\":192,\"caption\":\"RoseHosting\"},\"image\":{\"@id\":\"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/RoseHosting\",\"https:\/\/x.com\/rosehosting\",\"https:\/\/www.linkedin.com\/in\/rosehosting\/\"],\"description\":\"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.\",\"email\":\"info@rosehosting.com\",\"telephone\":\"(314) 275-0414\",\"legalName\":\"Rose Web Services LLC\",\"foundingDate\":\"2001-04-02\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"11\",\"maxValue\":\"50\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713\",\"name\":\"Jeff Wilson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"caption\":\"Jeff Wilson\"},\"description\":\"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.\",\"sameAs\":[\"https:\/\/www.rosehosting.com\",\"https:\/\/www.facebook.com\/rosehosting.helpdesk\"],\"url\":\"https:\/\/www.rosehosting.com\/blog\/author\/jwilson\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Linux Grep Guide for Advanced Users | RoseHosting","description":"Linux Grep Guide for Advanced Users | RoseHosting","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:\/\/www.rosehosting.com\/blog\/linux-grep-guide-for-advanced-users\/","og_locale":"en_US","og_type":"article","og_title":"Linux Grep Guide for Advanced Users","og_description":"Linux Grep Guide for Advanced Users | RoseHosting","og_url":"https:\/\/www.rosehosting.com\/blog\/linux-grep-guide-for-advanced-users\/","og_site_name":"RoseHosting","article_publisher":"https:\/\/www.facebook.com\/RoseHosting","article_author":"https:\/\/www.facebook.com\/rosehosting.helpdesk","article_published_time":"2018-09-25T06:55:35+00:00","article_modified_time":"2023-04-05T07:11:06+00:00","og_image":[{"width":742,"height":372,"url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/Linux-Grep-Guide-for-Advanced-Users.jpg","type":"image\/jpeg"}],"author":"Jeff Wilson","twitter_card":"summary_large_image","twitter_creator":"@rosehosting","twitter_site":"@rosehosting","twitter_misc":{"Written by":"Jeff Wilson","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.rosehosting.com\/blog\/linux-grep-guide-for-advanced-users\/#article","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/linux-grep-guide-for-advanced-users\/"},"author":{"name":"Jeff Wilson","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713"},"headline":"Linux Grep Guide for Advanced Users","datePublished":"2018-09-25T06:55:35+00:00","dateModified":"2023-04-05T07:11:06+00:00","mainEntityOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/linux-grep-guide-for-advanced-users\/"},"wordCount":787,"commentCount":0,"publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/linux-grep-guide-for-advanced-users\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/Linux-Grep-Guide-for-Advanced-Users.jpg","keywords":["advanced grep command","grep command","Linux"],"articleSection":["Guides","Linux"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.rosehosting.com\/blog\/linux-grep-guide-for-advanced-users\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.rosehosting.com\/blog\/linux-grep-guide-for-advanced-users\/","url":"https:\/\/www.rosehosting.com\/blog\/linux-grep-guide-for-advanced-users\/","name":"Linux Grep Guide for Advanced Users | RoseHosting","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/linux-grep-guide-for-advanced-users\/#primaryimage"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/linux-grep-guide-for-advanced-users\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/Linux-Grep-Guide-for-Advanced-Users.jpg","datePublished":"2018-09-25T06:55:35+00:00","dateModified":"2023-04-05T07:11:06+00:00","description":"Linux Grep Guide for Advanced Users | RoseHosting","breadcrumb":{"@id":"https:\/\/www.rosehosting.com\/blog\/linux-grep-guide-for-advanced-users\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.rosehosting.com\/blog\/linux-grep-guide-for-advanced-users\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/linux-grep-guide-for-advanced-users\/#primaryimage","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/Linux-Grep-Guide-for-Advanced-Users.jpg","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/09\/Linux-Grep-Guide-for-Advanced-Users.jpg","width":742,"height":372,"caption":"Linux Grep Guide for Advanced Users"},{"@type":"BreadcrumbList","@id":"https:\/\/www.rosehosting.com\/blog\/linux-grep-guide-for-advanced-users\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.rosehosting.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Linux Grep Guide for Advanced Users"}]},{"@type":"WebSite","@id":"https:\/\/www.rosehosting.com\/blog\/#website","url":"https:\/\/www.rosehosting.com\/blog\/","name":"RoseHosting.com","description":"Premium Linux Tutorials Since 2001","publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.rosehosting.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.rosehosting.com\/blog\/#organization","name":"RoseHosting","url":"https:\/\/www.rosehosting.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","width":192,"height":192,"caption":"RoseHosting"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/RoseHosting","https:\/\/x.com\/rosehosting","https:\/\/www.linkedin.com\/in\/rosehosting\/"],"description":"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.","email":"info@rosehosting.com","telephone":"(314) 275-0414","legalName":"Rose Web Services LLC","foundingDate":"2001-04-02","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"11","maxValue":"50"}},{"@type":"Person","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713","name":"Jeff Wilson","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","caption":"Jeff Wilson"},"description":"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.","sameAs":["https:\/\/www.rosehosting.com","https:\/\/www.facebook.com\/rosehosting.helpdesk"],"url":"https:\/\/www.rosehosting.com\/blog\/author\/jwilson\/"}]}},"_links":{"self":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/28283","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/comments?post=28283"}],"version-history":[{"count":3,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/28283\/revisions"}],"predecessor-version":[{"id":44387,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/28283\/revisions\/44387"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media\/28289"}],"wp:attachment":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media?parent=28283"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/categories?post=28283"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/tags?post=28283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}