{"id":4232,"date":"2024-04-27T12:05:28","date_gmt":"2024-04-27T06:35:28","guid":{"rendered":"https:\/\/cthecosmos.com\/?p=4232"},"modified":"2024-04-27T12:05:28","modified_gmt":"2024-04-27T06:35:28","slug":"find-and-grep","status":"publish","type":"post","link":"https:\/\/cthecosmos.com\/?p=4232","title":{"rendered":"FIND AND GREP"},"content":{"rendered":"\n<p class=\"has-black-color has-white-background-color has-text-color has-background has-link-color wp-elements-1 wp-block-paragraph\" style=\"font-size:17px;line-height:1.8\">For anyone who is working on Ubuntu\/ on a linux platform, they might have initially found it difficult for navigation along directories. In this post, we shall see a few of the commands and their syntax that would help you understand and make your navigation easy.<br><br>This is the base pattern we would be following:<br><br>\ud835\udc1f\ud835\udc22\ud835\udc27\ud835\udc1d \/\ud835\udc29\ud835\udc1a\ud835\udc2d\ud835\udc21\/\ud835\udc2d\ud835\udc28\/\ud835\udc2c\ud835\udc2d\ud835\udc1a\ud835\udc2b\ud835\udc2d -\ud835\udc2d\ud835\udc32\ud835\udc29\ud835\udc1e \ud835\udc1f -\ud835\udc1e\ud835\udc31\ud835\udc1e\ud835\udc1c \ud835\udc20\ud835\udc2b\ud835\udc1e\ud835\udc29 -\ud835\udc07 &#8216;\ud835\udc29\ud835\udc1a\ud835\udc2d\ud835\udc2d\ud835\udc1e\ud835\udc2b\ud835\udc27&#8217; {} \\;<br><br>&#8211; <em><strong>\/path\/to\/start<\/strong><\/em>: The directory where you want your search to begin.<br>&#8211; <em><strong>-type f<\/strong><\/em>: This restricts the search to files only.<br>&#8211; <em><strong>-exec<\/strong><\/em>: This allows you to run another command on the files that find locates.<br>&#8211; <strong><em>grep -H &#8216;pattern&#8217;<\/em><\/strong>: The grep command searches within the file for the specified pattern. The -H option makes grep print the filename along with the matching line.<br>&#8211; <strong><em>{}<\/em><\/strong>: This is a placeholder that represents the current file that find is processing.<br>&#8211; <strong><em>\\;<\/em><\/strong>: This ends the -exec command.<br><br><br>1)<strong> Search recursively but exclude certain directories:<\/strong><br><br><strong><em>find \/path\/to\/start -type d \\( -name &#8220;exclude_dir1&#8243; -o -name  exclude_dir2&#8221; \\) -prune -o -type f -print | xargs grep -H &#8216;pattern&#8217;<br><\/em><\/strong><br><br><strong>2) Search with case-insensitive matching using grep:<\/strong><br><br><strong><em>find \/path\/to\/start -type f -print | xargs grep -iH &#8216;pattern&#8217;<\/em><\/strong><br><br><br><br><strong>3) Search for multiple patterns using grep with the -e flag:<\/strong><br><br><strong><em>find \/path\/to\/start -type f -print | xargs grep -H -e &#8216;pattern1&#8217; -e &#8216;pattern2&#8217;<\/em><\/strong><br><br><br><strong>4) Find files that do NOT contain a certain pattern using grep -L:<\/strong><br><br><strong><em>find \/path\/to\/start -type f -print | xargs grep -L &#8216;pattern&#8217;<\/em><\/strong><br><br><br><br><strong>5) Search for a pattern in files modified in the last N days using find with -mtime:<\/strong><br><strong><br><em>find \/path\/to\/start -type f -mtime -N -print | xargs grep -H &#8216;pattern&#8217;<\/em><\/strong><br><br><br><br><strong>6) Using xargs for faster searching with grep in large file sets:<\/strong><br><br><strong><em>find \/path\/to\/start -type f -name &#8220;*.php&#8221; -print | xargs grep -H &#8216;database&#8217;<\/em><\/strong><br><br><br><br><strong>7) Search for files based on size and then grep within those files:<\/strong><br><br><strong><em>find \/path\/to\/start -type f -size +1M -print | xargs grep -H &#8216;pattern&#8217;<\/em><\/strong><br><br><br><br><strong>8) Search for a pattern within files accessed or modified recently:<\/strong><br><br><strong><em>find \/path\/to\/start -type f -atime -2 -print | xargs grep -H &#8216;pattern&#8217;<\/em><\/strong><br><strong><br><\/strong><br><br><strong>9) Find and grep within specific file types:<\/strong><br><br><strong><em>find \/path\/to\/start \\( -name &#8220;*.txt&#8221; -o -name &#8220;*.md&#8221; \\) -print | xargs grep -H &#8216;pattern&#8217;<br><\/em><\/strong><br><br><br><strong>10) Using grep with context to show lines before and after the match:<\/strong><br><br><strong><em>find \/path\/to\/start -type f -print | xargs grep -H -A3 -B3 &#8216;pattern&#8217;<\/em><\/strong><br><br><br><br><strong>11) Searching for a pattern in all but certain file types:<\/strong><br><br><strong><em>find \/path\/to\/start -type f ! -name &#8220;*.log&#8221; -print | xargs grep -H &#8216;pattern&#8217;<\/em><\/strong><br><br><br><br><strong>12) Search for a pattern within files, excluding certain patterns:<\/strong><br><strong><em>find \/path\/to\/start -type f -print | xargs grep -H &#8216;pattern&#8217; | grep -v &#8216;exclude_pattern&#8217;<br><\/em><\/strong><br><br><br><strong>13) Find files based on depth to avoid recursive searching and grep within those:<\/strong><br><strong><br><em>find \/path\/to\/start -maxdepth 1 -type f -print | xargs grep -H &#8216;pattern&#8217;<\/em><\/strong><br><br><br><br><strong>14) Using zgrep to search within compressed files:<\/strong><br><strong><em>find \/path\/to\/start -type f -name &#8216;*.gz&#8217; -print | xargs zgrep &#8216;pattern&#8217;<\/em><\/strong><br><br><br><br><strong>15) Using grep to show only the filenames without the matching content:<\/strong><br><br><strong><em>find \/path\/to\/start -type f -print | xargs grep -l &#8216;pattern&#8217;<\/em><\/strong><\/p>\n\n\n\n<p class=\"has-black-color has-white-background-color has-text-color has-background has-link-color wp-elements-2 wp-block-paragraph\">LinkedIn Post: <a href=\"https:\/\/www.linkedin.com\/posts\/t-yashwanth-naidu_earlycareer-embeddedsystems-learning-activity-7110845532901707776-u87N\/?utm_source=share&amp;utm_medium=member_desktop\">https:\/\/www.linkedin.com\/posts\/t-yashwanth-naidu_earlycareer-embeddedsystems-learning-activity-7110845532901707776-u87N\/?utm_source=share&amp;utm_medium=member_desktop<\/a><\/p>\n\n\n\n<p class=\"has-white-color has-text-color has-background has-link-color has-medium-font-size wp-elements-3 wp-block-paragraph\" style=\"background:linear-gradient(135deg,rgb(35,23,11) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)\">~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br><strong>An Article by: <\/strong>Yashwanth Naidu Tikkisetty<br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post provides essential commands for navigating directories on Ubuntu\/Linux, making directory navigation easier. The post includes commands for searching for specific patterns within files, filtering by file type, and excluding certain directories. Each command is accompanied by a brief explanation and example. This valuable resource can greatly enhance your Linux command line skills.<\/p>\n<a href=\"https:\/\/cthecosmos.com\/?p=4232\" class=\"more-link\">Read More <span class=\"screen-reader-text\">FIND AND GREP<\/span><\/a>","protected":false},"author":120055267,"featured_media":4233,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_wpcom_ai_launchpad_first_post":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"{title}\n\n{excerpt}\n\n{url}","jetpack_publicize_feature_enabled":false,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_wpas_customize_per_network":false,"jetpack_post_was_ever_published":false},"categories":[28627,30181,35264203,769114260,5495,952411],"tags":[772321195,772321193,3723469,18790084,771202926,88204,771201861,1354040,34920936],"class_list":["post-4232","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-embedded","category-embedded-systems","category-linux-3","category-linuxlearnings","category-operating-system","category-short-articles","tag-c-programming","tag-embedded-systems","tag-find-command","tag-grep-command","tag-grep-find-linux-command-line","tag-linux-fun","tag-linuxlearning-2","tag-short-article","tag-ubuntu-2","fallback-thumbnail"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.4 - aioseo.com -->\n\t<meta name=\"description\" content=\"This post provides essential commands for navigating directories on Ubuntu\/Linux, making directory navigation easier. The post includes commands for searching for specific patterns within files, filtering by file type, and excluding certain directories. Each command is accompanied by a brief explanation and example. This valuable resource can greatly enhance your Linux command line skills.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yashwanth Naidu Tikkisetty\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/cthecosmos.com\/?p=4232\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.4\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Yashwanth Naidu Tikkisetty - Embedded Systems | Space Blogger\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"FIND AND GREP - Yashwanth Naidu Tikkisetty\" \/>\n\t\t<meta property=\"og:description\" content=\"This post provides essential commands for navigating directories on Ubuntu\/Linux, making directory navigation easier. The post includes commands for searching for specific patterns within files, filtering by file type, and excluding certain directories. Each command is accompanied by a brief explanation and example. This valuable resource can greatly enhance your Linux command line skills.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/cthecosmos.com\/?p=4232\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/cthecosmos.com\/wp-content\/uploads\/2018\/08\/logo1.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/cthecosmos.com\/wp-content\/uploads\/2018\/08\/logo1.png\" \/>\n\t\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t\t<meta property=\"og:image:height\" content=\"1200\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2024-04-27T06:35:28+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2024-04-27T06:35:28+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"FIND AND GREP - Yashwanth Naidu Tikkisetty\" \/>\n\t\t<meta name=\"twitter:description\" content=\"This post provides essential commands for navigating directories on Ubuntu\/Linux, making directory navigation easier. The post includes commands for searching for specific patterns within files, filtering by file type, and excluding certain directories. Each command is accompanied by a brief explanation and example. This valuable resource can greatly enhance your Linux command line skills.\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/cthecosmos.com\/wp-content\/uploads\/2018\/08\/logo1.png\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/cthecosmos.com\\\/?p=4232#blogposting\",\"name\":\"FIND AND GREP - Yashwanth Naidu Tikkisetty\",\"headline\":\"FIND AND GREP\",\"author\":{\"@id\":\"https:\\\/\\\/cthecosmos.com\\\/?author=120055267#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/cthecosmos.com\\\/#person\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/cthecosmos.com\\\/wp-content\\\/uploads\\\/2024\\\/04\\\/find_grep.png?fit=5016%2C2096&ssl=1\",\"width\":5016,\"height\":2096},\"datePublished\":\"2024-04-27T12:05:28+05:30\",\"dateModified\":\"2024-04-27T12:05:28+05:30\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/cthecosmos.com\\\/?p=4232#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/cthecosmos.com\\\/?p=4232#webpage\"},\"articleSection\":\"Embedded, Embedded Systems, linux, linuxlearnings, Operating System, SHORT ARTICLES, c programming, Embedded Systems, FIND command, grep command, GREP FIND linux command line, Linux Fun, linuxlearning, SHORT ARTICLE, ubuntu\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/cthecosmos.com\\\/?p=4232#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/cthecosmos.com\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/cthecosmos.com\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/cthecosmos.com\\\/?cat=5495#listItem\",\"name\":\"Operating System\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/cthecosmos.com\\\/?cat=5495#listItem\",\"position\":2,\"name\":\"Operating System\",\"item\":\"https:\\\/\\\/cthecosmos.com\\\/?cat=5495\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/cthecosmos.com\\\/?p=4232#listItem\",\"name\":\"FIND AND GREP\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/cthecosmos.com\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/cthecosmos.com\\\/?p=4232#listItem\",\"position\":3,\"name\":\"FIND AND GREP\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/cthecosmos.com\\\/?cat=5495#listItem\",\"name\":\"Operating System\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/cthecosmos.com\\\/#person\",\"name\":\"Yashwanth Naidu Tikkisetty\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/cthecosmos.com\\\/?p=4232#personImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a02d9f38e4c924587b544c74f6d5de0c8469b6a5c684622f1aa4ea2ba65b17d8?s=96&d=identicon&r=g\",\"width\":96,\"height\":96,\"caption\":\"Yashwanth Naidu Tikkisetty\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/cthecosmos.com\\\/?author=120055267#author\",\"url\":\"https:\\\/\\\/cthecosmos.com\\\/?author=120055267\",\"name\":\"Yashwanth Naidu Tikkisetty\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/cthecosmos.com\\\/?p=4232#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a02d9f38e4c924587b544c74f6d5de0c8469b6a5c684622f1aa4ea2ba65b17d8?s=96&d=identicon&r=g\",\"width\":96,\"height\":96,\"caption\":\"Yashwanth Naidu Tikkisetty\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/cthecosmos.com\\\/?p=4232#webpage\",\"url\":\"https:\\\/\\\/cthecosmos.com\\\/?p=4232\",\"name\":\"FIND AND GREP - Yashwanth Naidu Tikkisetty\",\"description\":\"This post provides essential commands for navigating directories on Ubuntu\\\/Linux, making directory navigation easier. The post includes commands for searching for specific patterns within files, filtering by file type, and excluding certain directories. Each command is accompanied by a brief explanation and example. This valuable resource can greatly enhance your Linux command line skills.\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/cthecosmos.com\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/cthecosmos.com\\\/?p=4232#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/cthecosmos.com\\\/?author=120055267#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/cthecosmos.com\\\/?author=120055267#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/cthecosmos.com\\\/wp-content\\\/uploads\\\/2024\\\/04\\\/find_grep.png?fit=5016%2C2096&ssl=1\",\"@id\":\"https:\\\/\\\/cthecosmos.com\\\/?p=4232\\\/#mainImage\",\"width\":5016,\"height\":2096},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/cthecosmos.com\\\/?p=4232#mainImage\"},\"datePublished\":\"2024-04-27T12:05:28+05:30\",\"dateModified\":\"2024-04-27T12:05:28+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/cthecosmos.com\\\/#website\",\"url\":\"https:\\\/\\\/cthecosmos.com\\\/\",\"name\":\"Yashwanth Naidu Tikkisetty\",\"description\":\"Embedded Systems | Space Blogger\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/cthecosmos.com\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"FIND AND GREP - Yashwanth Naidu Tikkisetty","description":"This post provides essential commands for navigating directories on Ubuntu\/Linux, making directory navigation easier. The post includes commands for searching for specific patterns within files, filtering by file type, and excluding certain directories. Each command is accompanied by a brief explanation and example. This valuable resource can greatly enhance your Linux command line skills.","canonical_url":"https:\/\/cthecosmos.com\/?p=4232","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/cthecosmos.com\/?p=4232#blogposting","name":"FIND AND GREP - Yashwanth Naidu Tikkisetty","headline":"FIND AND GREP","author":{"@id":"https:\/\/cthecosmos.com\/?author=120055267#author"},"publisher":{"@id":"https:\/\/cthecosmos.com\/#person"},"image":{"@type":"ImageObject","url":"https:\/\/i0.wp.com\/cthecosmos.com\/wp-content\/uploads\/2024\/04\/find_grep.png?fit=5016%2C2096&ssl=1","width":5016,"height":2096},"datePublished":"2024-04-27T12:05:28+05:30","dateModified":"2024-04-27T12:05:28+05:30","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/cthecosmos.com\/?p=4232#webpage"},"isPartOf":{"@id":"https:\/\/cthecosmos.com\/?p=4232#webpage"},"articleSection":"Embedded, Embedded Systems, linux, linuxlearnings, Operating System, SHORT ARTICLES, c programming, Embedded Systems, FIND command, grep command, GREP FIND linux command line, Linux Fun, linuxlearning, SHORT ARTICLE, ubuntu"},{"@type":"BreadcrumbList","@id":"https:\/\/cthecosmos.com\/?p=4232#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/cthecosmos.com\/#listItem","position":1,"name":"Home","item":"https:\/\/cthecosmos.com\/","nextItem":{"@type":"ListItem","@id":"https:\/\/cthecosmos.com\/?cat=5495#listItem","name":"Operating System"}},{"@type":"ListItem","@id":"https:\/\/cthecosmos.com\/?cat=5495#listItem","position":2,"name":"Operating System","item":"https:\/\/cthecosmos.com\/?cat=5495","nextItem":{"@type":"ListItem","@id":"https:\/\/cthecosmos.com\/?p=4232#listItem","name":"FIND AND GREP"},"previousItem":{"@type":"ListItem","@id":"https:\/\/cthecosmos.com\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/cthecosmos.com\/?p=4232#listItem","position":3,"name":"FIND AND GREP","previousItem":{"@type":"ListItem","@id":"https:\/\/cthecosmos.com\/?cat=5495#listItem","name":"Operating System"}}]},{"@type":"Person","@id":"https:\/\/cthecosmos.com\/#person","name":"Yashwanth Naidu Tikkisetty","image":{"@type":"ImageObject","@id":"https:\/\/cthecosmos.com\/?p=4232#personImage","url":"https:\/\/secure.gravatar.com\/avatar\/a02d9f38e4c924587b544c74f6d5de0c8469b6a5c684622f1aa4ea2ba65b17d8?s=96&d=identicon&r=g","width":96,"height":96,"caption":"Yashwanth Naidu Tikkisetty"}},{"@type":"Person","@id":"https:\/\/cthecosmos.com\/?author=120055267#author","url":"https:\/\/cthecosmos.com\/?author=120055267","name":"Yashwanth Naidu Tikkisetty","image":{"@type":"ImageObject","@id":"https:\/\/cthecosmos.com\/?p=4232#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/a02d9f38e4c924587b544c74f6d5de0c8469b6a5c684622f1aa4ea2ba65b17d8?s=96&d=identicon&r=g","width":96,"height":96,"caption":"Yashwanth Naidu Tikkisetty"}},{"@type":"WebPage","@id":"https:\/\/cthecosmos.com\/?p=4232#webpage","url":"https:\/\/cthecosmos.com\/?p=4232","name":"FIND AND GREP - Yashwanth Naidu Tikkisetty","description":"This post provides essential commands for navigating directories on Ubuntu\/Linux, making directory navigation easier. The post includes commands for searching for specific patterns within files, filtering by file type, and excluding certain directories. Each command is accompanied by a brief explanation and example. This valuable resource can greatly enhance your Linux command line skills.","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/cthecosmos.com\/#website"},"breadcrumb":{"@id":"https:\/\/cthecosmos.com\/?p=4232#breadcrumblist"},"author":{"@id":"https:\/\/cthecosmos.com\/?author=120055267#author"},"creator":{"@id":"https:\/\/cthecosmos.com\/?author=120055267#author"},"image":{"@type":"ImageObject","url":"https:\/\/i0.wp.com\/cthecosmos.com\/wp-content\/uploads\/2024\/04\/find_grep.png?fit=5016%2C2096&ssl=1","@id":"https:\/\/cthecosmos.com\/?p=4232\/#mainImage","width":5016,"height":2096},"primaryImageOfPage":{"@id":"https:\/\/cthecosmos.com\/?p=4232#mainImage"},"datePublished":"2024-04-27T12:05:28+05:30","dateModified":"2024-04-27T12:05:28+05:30"},{"@type":"WebSite","@id":"https:\/\/cthecosmos.com\/#website","url":"https:\/\/cthecosmos.com\/","name":"Yashwanth Naidu Tikkisetty","description":"Embedded Systems | Space Blogger","inLanguage":"en-US","publisher":{"@id":"https:\/\/cthecosmos.com\/#person"}}]},"og:locale":"en_US","og:site_name":"Yashwanth Naidu Tikkisetty - Embedded Systems | Space Blogger","og:type":"article","og:title":"FIND AND GREP - Yashwanth Naidu Tikkisetty","og:description":"This post provides essential commands for navigating directories on Ubuntu\/Linux, making directory navigation easier. The post includes commands for searching for specific patterns within files, filtering by file type, and excluding certain directories. Each command is accompanied by a brief explanation and example. This valuable resource can greatly enhance your Linux command line skills.","og:url":"https:\/\/cthecosmos.com\/?p=4232","og:image":"https:\/\/cthecosmos.com\/wp-content\/uploads\/2018\/08\/logo1.png","og:image:secure_url":"https:\/\/cthecosmos.com\/wp-content\/uploads\/2018\/08\/logo1.png","og:image:width":1200,"og:image:height":1200,"article:published_time":"2024-04-27T06:35:28+00:00","article:modified_time":"2024-04-27T06:35:28+00:00","twitter:card":"summary_large_image","twitter:title":"FIND AND GREP - Yashwanth Naidu Tikkisetty","twitter:description":"This post provides essential commands for navigating directories on Ubuntu\/Linux, making directory navigation easier. The post includes commands for searching for specific patterns within files, filtering by file type, and excluding certain directories. Each command is accompanied by a brief explanation and example. This valuable resource can greatly enhance your Linux command line skills.","twitter:image":"https:\/\/cthecosmos.com\/wp-content\/uploads\/2018\/08\/logo1.png"},"aioseo_meta_data":{"post_id":"4232","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":"","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":"2025-08-31 20:21:07","updated":"2025-08-31 20:21:07","seo_analyzer_scan_date":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/cthecosmos.com\/\" 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:\/\/cthecosmos.com\/?cat=5495\" title=\"Operating System\">Operating System<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tFIND AND GREP\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/cthecosmos.com\/"},{"label":"Operating System","link":"https:\/\/cthecosmos.com\/?cat=5495"},{"label":"FIND AND GREP","link":"https:\/\/cthecosmos.com\/?p=4232"}],"jetpack_publicize_connections":[],"jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8CiEf-16g","jetpack-related-posts":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/cthecosmos.com\/wp-content\/uploads\/2024\/04\/find_grep.png?fit=5016%2C2096&ssl=1","_links":{"self":[{"href":"https:\/\/cthecosmos.com\/index.php?rest_route=\/wp\/v2\/posts\/4232","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cthecosmos.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cthecosmos.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cthecosmos.com\/index.php?rest_route=\/wp\/v2\/users\/120055267"}],"replies":[{"embeddable":true,"href":"https:\/\/cthecosmos.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4232"}],"version-history":[{"count":7,"href":"https:\/\/cthecosmos.com\/index.php?rest_route=\/wp\/v2\/posts\/4232\/revisions"}],"predecessor-version":[{"id":4240,"href":"https:\/\/cthecosmos.com\/index.php?rest_route=\/wp\/v2\/posts\/4232\/revisions\/4240"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cthecosmos.com\/index.php?rest_route=\/wp\/v2\/media\/4233"}],"wp:attachment":[{"href":"https:\/\/cthecosmos.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4232"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cthecosmos.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4232"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cthecosmos.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4232"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}