{"id":23727821,"url":"https://github.com/mutalis/grep-fast-search","last_synced_at":"2026-02-06T17:02:11.780Z","repository":{"id":66975400,"uuid":"85911220","full_name":"mutalis/grep-fast-search","owner":"mutalis","description":"mts-explore-grep","archived":false,"fork":false,"pushed_at":"2017-01-21T12:00:48.000Z","size":1,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-03T17:08:55.852Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mutalis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-23T05:38:49.000Z","updated_at":"2021-10-23T12:45:23.000Z","dependencies_parsed_at":"2023-05-16T09:15:36.718Z","dependency_job_id":null,"html_url":"https://github.com/mutalis/grep-fast-search","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mutalis/grep-fast-search","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutalis%2Fgrep-fast-search","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutalis%2Fgrep-fast-search/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutalis%2Fgrep-fast-search/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutalis%2Fgrep-fast-search/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mutalis","download_url":"https://codeload.github.com/mutalis/grep-fast-search/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutalis%2Fgrep-fast-search/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29169384,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T16:33:35.550Z","status":"ssl_error","status_checked_at":"2026-02-06T16:33:30.716Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-31T01:45:36.323Z","updated_at":"2026-02-06T17:02:11.773Z","avatar_url":"https://github.com/mutalis.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Use Grep for Fast Search from the Command Line\n\n## 1. Search the contents of files using grep\n\n```bash\ngrep version package.json\ngrep gulp package.json\n```\n\n```bash\ngrep \"#\" codestyle.md contributing.md readme.md\ngrep \"#\" *.md\n```\n\n## 2. Search directory contents recursively using grep\n```bash\ngrep toggle .\ngrep toggle ./*\n\ngrep -r toggle .\ngrep -r toggle examples/react/js\n```\n\n## 3. Use find to search for filename patterns\n```bash\nfind . -name \"*jsx\"\nfind . -name \"*md\"\n```\n\n```bash\nfind examples/ -name \"*Spec.js\"\n```\n\n## 4. Search matching files by combining find and grep with xargs\n```bash\nfind examples -name \"*Spec.js | xargs\"\nfind examples -name \"*Spec.js | echo\"\n```\n\n```bash\nfind examples -name \"*Spec.js\" | xargs grep \"describe\"\nfind examples -name \"*Spec.js\" | xargs grep \"should\"\n```\n\n```bash\ngrep -r --include=\"*Spec.js\" \"should \" examples/\n```\n\n## 5. Search the contents of a git repository with git grep\n```bash\ngrep -r bind\n```\n\n```bash\ngit grep bind \ngrep -r --color bind .\n```\n\n## 6. Show context around matches using grep\n```bash\ngrep \"#\" *.md\ngrep -n \"#\" *.md\ngrep -A 2 *.md\n\ngrep -A 2 \"#\" *.md\ngrep -A 2 --color \"#\" *.md\ngrep -B 2 --color \"#\" *.md\ngrep -C 2 --color \"#\" *.md\n```\n\n```bash\ngrep --color -n -C 2 \"#\" *.md\n```\n\n## 7. Search for basic patterns using grep\n```bash\ngrep --color \"h.\" readme.md\ngrep --color \"http.\" readme.md\n```\n\n```bash\ngrep --color \"\\.com\" readme.md\ngrep --color \"##*\" readme.md\n```\n\n```bash\ngrep --color \"(.*)\" readme.md\n```\n\n## 8. Use grep's extended regular expressions to find complex patterns\n```bash\ngrep --color \"https\" readme.md\ngrep --color \"http.\" readme.md\n```\n\n```bash\ngrep --color \"https\\?\" readme.md\ngrep --color \"https\\+\" readme.md\n```\n\n```bash\ngrep --color \"#*\" readme.md\ngrep --color \"#\\+\" readme.md\ngrep --color \"##\\+\" readme.md\n```\n\n```bash\ngrep --color -E \"###?\" readme.md\ngrep --color -E \"###+\" readme.md\nor\ngrep --color \"###\\?\" readme.md\ngrep --color \"###\\+\" readme.md\n```\n\n## 9. Search for optional patterns with grep OR\n```bash\necho \"is it grey or gray?\" | grep --color \"grey\\|gray\"\nor\necho \"is it grey or gray?\" | grep --color -E \"grey|gray\"\n```\n\n```bash\ngrep --color -rE \"grey|gray\" examples/\n```\n\n## 10. Specify line beginning and end in patterns using grep\n```bash\ngrep \"#\" app-spec.md\ngrep --color \"^#\" app-spec.md\n```\n\n```bash\ngrep --color \",\" app-spec.md\n```\n\n```bash\ngrep --color -r \"^import .* from\" examples/\n```\n\n## 11. Match classes of characters using bracket expressions with grep\n```bash\necho abc123 | grep --color \"[ab]\"\necho abc123 | grep --color \"[a-z]\"\necho abc123 | grep --color \"[1-9]\"\n```\n\n```bash\ngrep --color \"de[a-z]*er\" readme.md\nor\ngrep --color \"de[[:alpha:]]*er\" readme.md\n```\n\n```bash\nfind . -name \"*js\" | grep --color -E \"[sS]pec\"\n```\n\n## 12. Search with groups using grep\n```bash\ngrep -rE \"grey|gray\" .\ngrep -rE --color \"(grey|gray)\\'\" .\ngrep -rE --color \"(grey|gray)(\\'|\\\")\" .\ngrep -rE --color \"(grey|gray)(\\'|\\\"): (\\'|\\\")#?[[:xdigit:]]+\" .\n```\n\n## 13. Find matches excluding a pattern with grep\n```bash\nfind examples/agularjs -name \"*js\"\nfind examples/agularjs -name \"*js\" | grep -v \"node_modules\"\nfind examples/agularjs -name \"*js\" | grep -vE \"node_modules|Spec\"\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmutalis%2Fgrep-fast-search","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmutalis%2Fgrep-fast-search","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmutalis%2Fgrep-fast-search/lists"}