{"id":4601,"date":"2017-04-08T07:05:36","date_gmt":"2017-04-08T07:05:36","guid":{"rendered":"https:\/\/www.rsoftsolution.com\/blog\/10-ways-to-use-grep-to-search-files-in-linux.html"},"modified":"2017-04-08T07:05:36","modified_gmt":"2017-04-08T07:05:36","slug":"10-ways-to-use-grep-to-search-files-in-linux","status":"publish","type":"post","link":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/10-ways-to-use-grep-to-search-files-in-linux.html","title":{"rendered":"10 ways to use grep to hunt files in Linux"},"content":{"rendered":"<figure class=\"image pull-none image-large\"><span class=\"img aspect-set \"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.rsoftsolution.com\/blog\/wp-content\/plugins\/RSSPoster_PRO\/cache\/7e685_ss2.jpg?w=640&#038;ssl=1\" class=\"\" alt=\"ss2.jpg\"  \/><\/span><figcaption \/><\/figure>\n<p>Windows hunt is not though certain charms, though when we need to find files or their contents, or hunt for specific complement information, a grep authority in Linux never ceases to dazzle me by a energy and versatility.<\/p>\n<p>There are mixed versions of grep; plain unchanging grep, egrep (extended grep) and fgrep (fixed prep). The latter dual have opposite methods for operative with characters and hunt strings.  I&#8217;ll concentration on unchanging grep for a purpose of this article, that is dictated as a commencement educational for this accessible and arguable command.<\/p>\n<p>The syntax of grep is as follows:<\/p>\n<p><strong>grep [options] settlement [files]<\/strong><\/p>\n<p>The options and patterns we can use with grep are sundry and diverse.  Here are 10 examples to assistance whet your skills.<\/p>\n<h2>1.\tSearch a record for a specific word<\/h2>\n<p>This is unequivocally one of a many facile uses for grep. Let&#8217;s contend we wish to check a essence of a \/var\/log\/secure record for any instances of a failure.  we would type:<\/p>\n<p><strong>grep disaster \/var\/log\/secure<\/strong><\/p>\n<p>This is an instance of what grep competence afterwards return:<\/p>\n<blockquote>\n<p>Apr  4 06:45:29 smatteso-vm1 sshd[14836]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=qualys-corp.lowell.litle.com  user=8boa5lv2rn8pso8<\/p>\n<p>Apr  4 06:45:31 smatteso-vm1 sshd[14844]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=qualys-corp.lowell.litle.com  user=13hr26mnm8wo4k<\/p>\n<\/blockquote>\n<p>Add a -i switch (e.g. grep -i) to control a box unresponsive search.  In a instance above this would lapse a lowercase &#8220;failure,&#8221; uppercase &#8220;FAILURE&#8221; or any mixed thereof, such as &#8220;Failure.&#8221;.<\/p>\n<h2>2.\tSearch a record for mixed words<\/h2>\n<p>This authority permits we to check for mixed difference in a record &#8211; note a use of a singular quotes, a backslash and a siren authority between them:<\/p>\n<p><strong>grep &#8216;opened|closed&#8217; \/var\/log\/secure<\/strong><\/p>\n<p>This is what grep competence return:<\/p>\n<blockquote>\n<p>Apr  2 03:45:07 smatteso-vm1 sshd[16278]: Connection sealed by 10.1.7.101<\/p>\n<p>Apr  2 03:46:42 smatteso-vm1 su: pam_unix(su-l:session): event non-stop for user phxinst1 by (uid=0)<\/p>\n<p>Apr  2 03:46:45 smatteso-vm1 su: pam_unix(su-l:session): event sealed for user phxinst1<\/p>\n<p>Apr  2 03:46:45 smatteso-vm1 su: pam_unix(su-l:session): event non-stop for user phxinst1 by (uid=0)<\/p>\n<\/blockquote>\n<h2>3.\tGet an instance count<\/h2>\n<p>You competence not wish to indeed see a outlay of a grep authority though have it tell we how many matches your hunt found.  This is achieved regulating a -c (count) switch:<\/p>\n<p><strong>grep disaster \/var\/log\/secure -c<\/strong><\/p>\n<p>Grep will lapse a series like this:<\/p>\n<p>12<\/p>\n<p>You can do some crafty things with this switch.  For instance, if we wish to know how many processors are in my complement we could type:<\/p>\n<p><strong>grep -c processor \/proc\/cpuinfo<\/strong><\/p>\n<h2>4.\tDisplay a line numbers of any match<\/h2>\n<p>It can be useful to know that line series your hunt formula seem on.  To do so, supplement a -n (number) switch:<\/p>\n<p><strong>grep -n disaster \/var\/log\/secure<\/strong><\/p>\n<p>Grep would afterwards lapse something like this: <\/p>\n<blockquote>\n<p>1601:Apr  4 06:45:29 smatteso-vm1 sshd[14836]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=qualys-corp.lowell.litle.com  user=8boa5lv2rn8pso8<\/p>\n<p>1612:Apr  4 06:45:31 smatteso-vm1 sshd[14844]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=qualys-corp.lowell.litle.com  user=13hr26mnm8wo4k<\/p>\n<\/blockquote>\n<h2>5.\tReturn usually a specific series of matches<\/h2>\n<p>Let&#8217;s contend we wish to usually see a initial 5 hunt results.  we can slight these down regulating a -m (maximum count) switch:<\/p>\n<p><strong>grep -m5 disaster \/var\/log\/secure<\/strong><\/p>\n<p>Here&#8217;s an instance of a results:<\/p>\n<blockquote>\n<p>Apr  4 06:45:29 smatteso-vm1 sshd[14836]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=qualys-corp.lowell.litle.com  user=8boa5lv2rn8pso8<\/p>\n<p>Apr  4 06:45:31 smatteso-vm1 sshd[14844]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=qualys-corp.lowell.litle.com  user=13hr26mnm8wo4k<\/p>\n<\/blockquote>\n<p>Note there can't be a space between &#8220;-m&#8221; and your limit count value.<\/p>\n<h2>6.\tDisplay all entries that are NOT a match.<\/h2>\n<p>There are some scenarios in that we competence wish to do a retreat hunt and uncover formula that do NOT compare your input.  Just supplement a -v switch here.  For instance, to see entries in a \/var\/log\/secure record that do not paint a word &#8220;failure&#8221; type:<\/p>\n<p><strong>grep -v disaster \/var\/log\/secure<\/strong><\/p>\n<p>And afterwards we would get formula like this: <\/p>\n<blockquote>\n<p>Apr  2 03:45:07 smatteso-vm1 sshd[16278]: Connection sealed by 10.1.7.101<\/p>\n<p>Apr  2 03:46:42 smatteso-vm1 su: pam_unix(su-l:session): event non-stop for user phxinst1 by (uid=0)<\/p>\n<p>Apr  2 03:46:45 smatteso-vm1 su: pam_unix(su-l:session): event sealed for user phxinst1<\/p>\n<p>Apr  2 03:46:45 smatteso-vm1 su: pam_unix(su-l:session): event non-stop for user phxinst1 by (uid=0)<\/p>\n<\/blockquote>\n<p>Of march we can mix strings such as -v and -n:<\/p>\n<p><strong>grep -v -n disaster \/var\/log\/secure<\/strong><\/p>\n<p>Which would uncover we all a non-matching entries with their compared line numbers:<\/p>\n<blockquote>\n<p>1:Apr  2 03:45:07 smatteso-vm1 sshd[16278]: Connection sealed by 10.1.7.101<\/p>\n<p>2:Apr  2 03:46:42 smatteso-vm1 su: pam_unix(su-l:session): event non-stop for user phxinst1 by (uid=0)<\/p>\n<p>3:Apr  2 03:46:45 smatteso-vm1 su: pam_unix(su-l:session): event sealed for user phxinst1<\/p>\n<p>4:Apr  2 03:46:45 smatteso-vm1 su: pam_unix(su-l:session): event non-stop for user phxinst1 by (uid=0)<\/p>\n<p>5:Apr  2 03:46:48 smatteso-vm1 su: pam_unix(su-l:session): event sealed for user phxinst1<\/p>\n<\/blockquote>\n<h2>7.\tSearch opposite mixed files<\/h2>\n<p>Grep can do most some-more than usually hunt a essence of a specific file.  You can use what&#8217;s famous as a recursive hunt to cover whole directories, subdirectories, or a whole record complement and get formula arrangement any filename that contains your hunt value.  <\/p>\n<p>This is achieved regulating a -r switch, that I&#8217;ll use to hunt for my user comment name in a \/etc directory:<\/p>\n<p><strong>grep -r &#8220;smatteso&#8221; \/etc<\/strong><\/p>\n<p>Here&#8217;s an instance of a results:<\/p>\n<blockquote>\n<p>\/etc\/hosts:10.1.52.237  smatteso-vm1.dwi.testdomain.com smatteso-vm1<\/p>\n<p>\/etc\/sysconfig\/network-scripts\/ifcfg-eth0:HOSTNAME=&#8221;smatteso-vm1&#8243;<\/p>\n<p>\/etc\/sysconfig\/rhn\/systemid:valuestringsmatteso-vm1.dwi.testdomain.com\/string\/value<\/p>\n<p>\/etc\/sysconfig\/network:HOSTNAME=smatteso-vm1<\/p>\n<\/blockquote>\n<p>You can hunt a whole record complement by changing that &#8220;\/etc&#8221; to &#8220;\/&#8221;:<\/p>\n<p><strong>grep -r &#8220;smatteso&#8221; \/<\/strong><\/p>\n<p>(note this can be utterly a time-consuming operation!)<\/p>\n<h2>8.\tDisplay usually a filenames that compare a search<\/h2>\n<p>I&#8217;m not a fan of clutter, so to get usually a list of filenames that compare my hunt (and not a essence of a files themselves) we can supplement a -l switch:<\/p>\n<p><strong>grep -rl &#8220;smatteso&#8221; \/etc<\/strong><\/p>\n<p>Which would lapse formula like this:<\/p>\n<blockquote>\n<p>\/etc\/hosts<\/p>\n<p>\/etc\/sysconfig\/network-scripts\/ifcfg-eth0<\/p>\n<p>\/etc\/sysconfig\/rhn\/systemid<\/p>\n<p>\/etc\/sysconfig\/network<\/p>\n<\/blockquote>\n<p>Just as discussed earlier, we can flip this to arrangement a filenames that do not enclose your hunt term(s), regulating a -L switch rather than -l:<\/p>\n<p><strong>grep -rL &#8220;smatteso&#8221; \/etc<\/strong><\/p>\n<h2><strong \/><strong>9.\tSearch for messages logged by date<\/strong><\/h2>\n<p>One generally useful component when regulating grep is to brush by record files acid for messages that were logged on a certain date.  Say we wish to see all logged on Apr 5th:<\/p>\n<p><strong>grep &#8220;Apr  5&#8221; \/var\/log\/messages<\/strong><\/p>\n<p>I would get formula like this:<\/p>\n<blockquote>\n<p>Apr  5 00:00:01 smatteso-vm1 audispd: node=smatteso-vm1 type=USER_ACCT msg=audit(1491364801.741:135867): user pid=50149 uid=0 auid=4294967295 ses=4294967295 msg=&#8217;op=PAM:accounting acct=&#8221;phxinst1&#8243; exe=&#8221;\/usr<\/p>\n<p>\/sbin\/crond&#8221; hostname=? addr=? terminal=cron res=success&#8217;<\/p>\n<p>Apr  5 00:00:01 smatteso-vm1 audispd: node=smatteso-vm1 type=USER_ACCT msg=audit(1491364801.741:135866): user pid=50143 uid=0 auid=4294967295 ses=4294967295<\/p>\n<\/blockquote>\n<p>This works for a specific timeframe too if we supplement that in, of course. To see usually a messages logged during 6 a.m. we can supplement &#8220;06:00&#8221; to a command:<\/p>\n<p><strong>grep &#8220;Apr  5 06:00&#8221; \/var\/log\/messages<\/strong><\/p>\n<blockquote>\n<p>Apr  5 06:00:01 smatteso-vm1 audispd: node=smatteso-vm1 type=USER_ACCT msg=audit(1491386401.774:143444): user pid=33946 uid=0 auid=4294967295 ses=4294967295 msg=&#8217;op=PAM:accounting acct=&#8221;phxinst1&#8243; exe=&#8221;\/usr\/sbin\/crond&#8221; hostname=? addr=? terminal=cron res=success&#8217;<\/p>\n<p>Apr  5 06:00:01 smatteso-vm1 audispd: node=smatteso-vm1 type=USER_ACCT msg=audit(1491386401.774:143445): user pid=33945 uid=0 auid=4294967295 ses=4294967295 msg=&#8217;op=PAM:accounting acct=&#8221;phxinst1&#8243; exe=&#8221;\/usr\/sbin\/crond&#8221; hostname=? addr=? terminal=cron res=success&#8217;<\/p>\n<\/blockquote>\n<h2>10.\tUse grep with other commands<\/h2>\n<p>Grep can be used with any other authority we like.  Let&#8217;s contend we wish to find any record files containing a word spice.  we can use a find authority and siren a formula to grep as follows:<\/p>\n<p><strong>find . -name &#8220;*.log&#8221; | grep -i spice<\/strong><\/p>\n<p>Here&#8217;s an instance of a results:<\/p>\n<p>.\/spice-vdagent.log<\/p>\n<p>The story file, that contains a list of recently-typed commands, is one of a best elements of Linux. It&#8217;s also probable to grep a story record for specific terms (for example, &#8220;pam_tally2&#8221;) to see when they were final used and what a suitable syntax is:<\/p>\n<p><strong>history | grep pam_tally2<\/strong><\/p>\n<blockquote>\n<p>  324  2017-04-06 13:50:25 pam_tally2<\/p>\n<p>  325  2017-04-06 13:50:29 pam_tally2 -u smatteso -r<\/p>\n<p>350  2017-04-06 14:05:44 story | grep pam_tally2<\/p>\n<\/blockquote>\n<p>You can use grep with &#8220;netstat&#8221; to demeanour during listening ports, contend pier 22 for instance:<\/p>\n<p><strong>netstat -anp | grep 22<\/strong><\/p>\n<blockquote>\n<p>tcp  0  0 0.0.0.0:22  0.0.0.0:*  LISTEN  2154\/sshd<\/p>\n<p>tcp  0  0 10.1.52.237:22  10.1.13.63:51704  ESTABLISHED 40441\/sshd<\/p>\n<p>tcp  0  32 10.1.52.237:22  10.1.13.63:51701  ESTABLISHED 40434\/sshd<\/p>\n<p>tcp  0  0 :::22  :::*  LISTEN  2154\/sshd<\/p>\n<\/blockquote>\n<p>You can also demeanour for a specific routine identifier.  In this instance I&#8217;ll check to see if any processes called &#8220;spice&#8221; are running:<\/p>\n<p><strong>ps -aux | grep spice<\/strong><\/p>\n<blockquote>\n<p>root  2179  0.0  0.0  15900  1076 ?  Ss  Mar31  0:00 \/usr\/sbin\/spice-vdagentd<\/p>\n<p>root  2855  0.0  0.0 103328  888 pts\/0  S+  12:41  0:00 grep spice<\/p>\n<p>gdm  5430  0.0  0.0  34488  1604 ?  Ss  Mar31  0:00 \/usr\/bin\/spice-vdagent<\/p>\n<\/blockquote>\n<p>This is usually a simple tip of a iceberg representing a capabilities of grep.  In a follow-up essay I&#8217;ll plead some some-more modernized methods for regulating a authority to get even some-more useful and granular results.<\/p>\n<p>To learn some-more about grep, use a authority &#8220;man grep&#8221; or &#8220;grep \u2014help.&#8221;  You can also download a chronicle of <a href=\"javascript:void(0)\">grep for Windows<\/a>.<\/p>\n<p><strong>Also see<\/strong><\/p>\n<p><a href=\"javascript:void(0)\">How to giveaway hoop space on Linux systems<\/a><a href=\"javascript:void(0)\"><br \/>How to resize a practical Red Hat Enterprise Linux partition<\/a><a href=\"javascript:void(0)\"><br \/>How to supplement chronicle control for your Linux \/etc directory<\/a><a href=\"javascript:void(0)\"><br \/>How to use a ramdisk on Linux<\/a><\/p>\n<p>Article source: http:\/\/www.techrepublic.com\/article\/10-ways-to-use-grep-to-search-files-in-linux\/#ftag=RSS56d97e7<\/p>","protected":false},"excerpt":{"rendered":"<p>Windows hunt is not though certain charms, though when we need to find files or their contents, or hunt for specific complement information, a grep authority in Linux never ceases <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[3],"tags":[10,7,14,15,6,12,11],"class_list":["post-4601","post","type-post","status-publish","format-standard","hentry","category-latest-update","tag-computer-news","tag-downloads","tag-microsoft-download-news","tag-networking-updates","tag-technology-update","tag-wordpress-plugin-download","tag-wordpress-theme-download"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.3 - aioseo.com -->\n\t<meta name=\"description\" content=\"Windows search is not without certain charms, but when I need to find files or their contents, or search for specific system information, the grep command in Linux never ceases to amaze me through its power and versatility.There are multiple versions of grep; plain regular grep, egrep (extended grep) and fgrep (fixed prep). The latter\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"R Software Solution\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.rbsitsoftwaresolution.in\/blog\/10-ways-to-use-grep-to-search-files-in-linux.html\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.3\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"IT and Latest Technology Updates - R Software Solution | a new innovation\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"10 ways to use grep to hunt files in Linux IT and Latest Technology Updates - R Software Solution\" \/>\n\t\t<meta property=\"og:description\" content=\"Windows search is not without certain charms, but when I need to find files or their contents, or search for specific system information, the grep command in Linux never ceases to amaze me through its power and versatility.There are multiple versions of grep; plain regular grep, egrep (extended grep) and fgrep (fixed prep). The latter\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.rbsitsoftwaresolution.in\/blog\/10-ways-to-use-grep-to-search-files-in-linux.html\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/www.rbsitsoftwaresolution.in\/blog\/wp-content\/uploads\/2019\/01\/logo.png?fit=94%2C59&#038;ssl=1\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/i0.wp.com\/www.rbsitsoftwaresolution.in\/blog\/wp-content\/uploads\/2019\/01\/logo.png?fit=94%2C59&#038;ssl=1\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2017-04-08T07:05:36+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2017-04-08T07:05:36+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"10 ways to use grep to hunt files in Linux IT and Latest Technology Updates - R Software Solution\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Windows search is not without certain charms, but when I need to find files or their contents, or search for specific system information, the grep command in Linux never ceases to amaze me through its power and versatility.There are multiple versions of grep; plain regular grep, egrep (extended grep) and fgrep (fixed prep). The latter\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/i0.wp.com\/www.rbsitsoftwaresolution.in\/blog\/wp-content\/uploads\/2019\/01\/logo.png?fit=94%2C59&amp;ssl=1\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.rbsitsoftwaresolution.in\\\/blog\\\/10-ways-to-use-grep-to-search-files-in-linux.html#article\",\"name\":\"10 ways to use grep to hunt files in Linux IT and Latest Technology Updates - R Software Solution\",\"headline\":\"10 ways to use grep to hunt files in Linux\",\"author\":{\"@id\":\"https:\\\/\\\/www.rbsitsoftwaresolution.in\\\/blog\\\/author\\\/admin#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.rbsitsoftwaresolution.in\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.rsoftsolution.com\\\/blog\\\/wp-content\\\/plugins\\\/RSSPoster_PRO\\\/cache\\\/7e685_ss2.jpg\",\"@id\":\"https:\\\/\\\/www.rbsitsoftwaresolution.in\\\/blog\\\/10-ways-to-use-grep-to-search-files-in-linux.html\\\/#articleImage\"},\"datePublished\":\"2017-04-08T07:05:36+00:00\",\"dateModified\":\"2017-04-08T07:05:36+00:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.rbsitsoftwaresolution.in\\\/blog\\\/10-ways-to-use-grep-to-search-files-in-linux.html#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rbsitsoftwaresolution.in\\\/blog\\\/10-ways-to-use-grep-to-search-files-in-linux.html#webpage\"},\"articleSection\":\"Latest Update, Computer news, Downloads, Microsoft Download News, Networking Updates, Technology Update, wordpress plugin download, wordpress theme download\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.rbsitsoftwaresolution.in\\\/blog\\\/10-ways-to-use-grep-to-search-files-in-linux.html#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.rbsitsoftwaresolution.in\\\/blog\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.rbsitsoftwaresolution.in\\\/blog\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.rbsitsoftwaresolution.in\\\/blog\\\/category\\\/latest-update#listItem\",\"name\":\"Latest Update\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.rbsitsoftwaresolution.in\\\/blog\\\/category\\\/latest-update#listItem\",\"position\":2,\"name\":\"Latest Update\",\"item\":\"https:\\\/\\\/www.rbsitsoftwaresolution.in\\\/blog\\\/category\\\/latest-update\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.rbsitsoftwaresolution.in\\\/blog\\\/10-ways-to-use-grep-to-search-files-in-linux.html#listItem\",\"name\":\"10 ways to use grep to hunt files in Linux\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.rbsitsoftwaresolution.in\\\/blog\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.rbsitsoftwaresolution.in\\\/blog\\\/10-ways-to-use-grep-to-search-files-in-linux.html#listItem\",\"position\":3,\"name\":\"10 ways to use grep to hunt files in Linux\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.rbsitsoftwaresolution.in\\\/blog\\\/category\\\/latest-update#listItem\",\"name\":\"Latest Update\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.rbsitsoftwaresolution.in\\\/blog\\\/#organization\",\"name\":\"IT and Latest Technology Updates - R Software Solution\",\"description\":\"a new innovation\",\"url\":\"https:\\\/\\\/www.rbsitsoftwaresolution.in\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/www.rbsitsoftwaresolution.in\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/01\\\/logo.png?fit=94%2C59&ssl=1\",\"@id\":\"https:\\\/\\\/www.rbsitsoftwaresolution.in\\\/blog\\\/10-ways-to-use-grep-to-search-files-in-linux.html\\\/#organizationLogo\",\"width\":94,\"height\":59},\"image\":{\"@id\":\"https:\\\/\\\/www.rbsitsoftwaresolution.in\\\/blog\\\/10-ways-to-use-grep-to-search-files-in-linux.html\\\/#organizationLogo\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.rbsitsoftwaresolution.in\\\/blog\\\/author\\\/admin#author\",\"url\":\"https:\\\/\\\/www.rbsitsoftwaresolution.in\\\/blog\\\/author\\\/admin\",\"name\":\"R Software Solution\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.rbsitsoftwaresolution.in\\\/blog\\\/10-ways-to-use-grep-to-search-files-in-linux.html#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3599de799aedfbc984125925734530ce764a18831ce50eacf4bd35eca6bad4db?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"R Software Solution\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.rbsitsoftwaresolution.in\\\/blog\\\/10-ways-to-use-grep-to-search-files-in-linux.html#webpage\",\"url\":\"https:\\\/\\\/www.rbsitsoftwaresolution.in\\\/blog\\\/10-ways-to-use-grep-to-search-files-in-linux.html\",\"name\":\"10 ways to use grep to hunt files in Linux IT and Latest Technology Updates - R Software Solution\",\"description\":\"Windows search is not without certain charms, but when I need to find files or their contents, or search for specific system information, the grep command in Linux never ceases to amaze me through its power and versatility.There are multiple versions of grep; plain regular grep, egrep (extended grep) and fgrep (fixed prep). The latter\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rbsitsoftwaresolution.in\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.rbsitsoftwaresolution.in\\\/blog\\\/10-ways-to-use-grep-to-search-files-in-linux.html#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.rbsitsoftwaresolution.in\\\/blog\\\/author\\\/admin#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.rbsitsoftwaresolution.in\\\/blog\\\/author\\\/admin#author\"},\"datePublished\":\"2017-04-08T07:05:36+00:00\",\"dateModified\":\"2017-04-08T07:05:36+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.rbsitsoftwaresolution.in\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.rbsitsoftwaresolution.in\\\/blog\\\/\",\"name\":\"IT and Latest Technology Updates - R Software Solution\",\"description\":\"a new innovation\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.rbsitsoftwaresolution.in\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"10 ways to use grep to hunt files in Linux IT and Latest Technology Updates - R Software Solution","description":"Windows search is not without certain charms, but when I need to find files or their contents, or search for specific system information, the grep command in Linux never ceases to amaze me through its power and versatility.There are multiple versions of grep; plain regular grep, egrep (extended grep) and fgrep (fixed prep). The latter","canonical_url":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/10-ways-to-use-grep-to-search-files-in-linux.html","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/10-ways-to-use-grep-to-search-files-in-linux.html#article","name":"10 ways to use grep to hunt files in Linux IT and Latest Technology Updates - R Software Solution","headline":"10 ways to use grep to hunt files in Linux","author":{"@id":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/author\/admin#author"},"publisher":{"@id":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/www.rsoftsolution.com\/blog\/wp-content\/plugins\/RSSPoster_PRO\/cache\/7e685_ss2.jpg","@id":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/10-ways-to-use-grep-to-search-files-in-linux.html\/#articleImage"},"datePublished":"2017-04-08T07:05:36+00:00","dateModified":"2017-04-08T07:05:36+00:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/10-ways-to-use-grep-to-search-files-in-linux.html#webpage"},"isPartOf":{"@id":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/10-ways-to-use-grep-to-search-files-in-linux.html#webpage"},"articleSection":"Latest Update, Computer news, Downloads, Microsoft Download News, Networking Updates, Technology Update, wordpress plugin download, wordpress theme download"},{"@type":"BreadcrumbList","@id":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/10-ways-to-use-grep-to-search-files-in-linux.html#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/#listItem","position":1,"name":"Home","item":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/category\/latest-update#listItem","name":"Latest Update"}},{"@type":"ListItem","@id":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/category\/latest-update#listItem","position":2,"name":"Latest Update","item":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/category\/latest-update","nextItem":{"@type":"ListItem","@id":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/10-ways-to-use-grep-to-search-files-in-linux.html#listItem","name":"10 ways to use grep to hunt files in Linux"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/10-ways-to-use-grep-to-search-files-in-linux.html#listItem","position":3,"name":"10 ways to use grep to hunt files in Linux","previousItem":{"@type":"ListItem","@id":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/category\/latest-update#listItem","name":"Latest Update"}}]},{"@type":"Organization","@id":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/#organization","name":"IT and Latest Technology Updates - R Software Solution","description":"a new innovation","url":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/","logo":{"@type":"ImageObject","url":"https:\/\/i0.wp.com\/www.rbsitsoftwaresolution.in\/blog\/wp-content\/uploads\/2019\/01\/logo.png?fit=94%2C59&ssl=1","@id":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/10-ways-to-use-grep-to-search-files-in-linux.html\/#organizationLogo","width":94,"height":59},"image":{"@id":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/10-ways-to-use-grep-to-search-files-in-linux.html\/#organizationLogo"}},{"@type":"Person","@id":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/author\/admin#author","url":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/author\/admin","name":"R Software Solution","image":{"@type":"ImageObject","@id":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/10-ways-to-use-grep-to-search-files-in-linux.html#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/3599de799aedfbc984125925734530ce764a18831ce50eacf4bd35eca6bad4db?s=96&d=mm&r=g","width":96,"height":96,"caption":"R Software Solution"}},{"@type":"WebPage","@id":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/10-ways-to-use-grep-to-search-files-in-linux.html#webpage","url":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/10-ways-to-use-grep-to-search-files-in-linux.html","name":"10 ways to use grep to hunt files in Linux IT and Latest Technology Updates - R Software Solution","description":"Windows search is not without certain charms, but when I need to find files or their contents, or search for specific system information, the grep command in Linux never ceases to amaze me through its power and versatility.There are multiple versions of grep; plain regular grep, egrep (extended grep) and fgrep (fixed prep). The latter","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/10-ways-to-use-grep-to-search-files-in-linux.html#breadcrumblist"},"author":{"@id":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/author\/admin#author"},"creator":{"@id":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/author\/admin#author"},"datePublished":"2017-04-08T07:05:36+00:00","dateModified":"2017-04-08T07:05:36+00:00"},{"@type":"WebSite","@id":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/#website","url":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/","name":"IT and Latest Technology Updates - R Software Solution","description":"a new innovation","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"IT and Latest Technology Updates - R Software Solution | a new innovation","og:type":"article","og:title":"10 ways to use grep to hunt files in Linux IT and Latest Technology Updates - R Software Solution","og:description":"Windows search is not without certain charms, but when I need to find files or their contents, or search for specific system information, the grep command in Linux never ceases to amaze me through its power and versatility.There are multiple versions of grep; plain regular grep, egrep (extended grep) and fgrep (fixed prep). The latter","og:url":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/10-ways-to-use-grep-to-search-files-in-linux.html","og:image":"https:\/\/i0.wp.com\/www.rbsitsoftwaresolution.in\/blog\/wp-content\/uploads\/2019\/01\/logo.png?fit=94%2C59&#038;ssl=1","og:image:secure_url":"https:\/\/i0.wp.com\/www.rbsitsoftwaresolution.in\/blog\/wp-content\/uploads\/2019\/01\/logo.png?fit=94%2C59&#038;ssl=1","article:published_time":"2017-04-08T07:05:36+00:00","article:modified_time":"2017-04-08T07:05:36+00:00","twitter:card":"summary_large_image","twitter:title":"10 ways to use grep to hunt files in Linux IT and Latest Technology Updates - R Software Solution","twitter:description":"Windows search is not without certain charms, but when I need to find files or their contents, or search for specific system information, the grep command in Linux never ceases to amaze me through its power and versatility.There are multiple versions of grep; plain regular grep, egrep (extended grep) and fgrep (fixed prep). The latter","twitter:image":"https:\/\/i0.wp.com\/www.rbsitsoftwaresolution.in\/blog\/wp-content\/uploads\/2019\/01\/logo.png?fit=94%2C59&ssl=1"},"aioseo_meta_data":{"post_id":"4601","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2023-07-13 09:00:16","updated":"2026-08-18 19:18:09","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.rbsitsoftwaresolution.in\/blog\/\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.rbsitsoftwaresolution.in\/blog\/category\/latest-update\" title=\"Latest Update\">Latest Update<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t10 ways to use grep to hunt files in Linux\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/"},{"label":"Latest Update","link":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/category\/latest-update"},{"label":"10 ways to use grep to hunt files in Linux","link":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/10-ways-to-use-grep-to-search-files-in-linux.html"}],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7WU2O-1cd","jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/wp-json\/wp\/v2\/posts\/4601","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/wp-json\/wp\/v2\/comments?post=4601"}],"version-history":[{"count":0,"href":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/wp-json\/wp\/v2\/posts\/4601\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/wp-json\/wp\/v2\/media?parent=4601"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/wp-json\/wp\/v2\/categories?post=4601"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rbsitsoftwaresolution.in\/blog\/wp-json\/wp\/v2\/tags?post=4601"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}