{"id":17085550,"url":"https://github.com/drmohundro/find-string","last_synced_at":"2025-04-12T21:08:19.102Z","repository":{"id":590126,"uuid":"224427","full_name":"drmohundro/Find-String","owner":"drmohundro","description":"A PowerShell script to provide functionality similar to grep or ack with highlighting.","archived":false,"fork":false,"pushed_at":"2023-05-19T15:45:27.000Z","size":74,"stargazers_count":61,"open_issues_count":0,"forks_count":4,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-04-12T21:07:43.742Z","etag":null,"topics":["ack","grep","powershell"],"latest_commit_sha":null,"homepage":"http://mohundro.com/blog/","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"robfig/config","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drmohundro.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2009-06-11T12:54:08.000Z","updated_at":"2024-01-28T12:07:13.000Z","dependencies_parsed_at":"2023-07-06T09:16:13.412Z","dependency_job_id":null,"html_url":"https://github.com/drmohundro/Find-String","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drmohundro%2FFind-String","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drmohundro%2FFind-String/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drmohundro%2FFind-String/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drmohundro%2FFind-String/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drmohundro","download_url":"https://codeload.github.com/drmohundro/Find-String/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631676,"owners_count":21136562,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["ack","grep","powershell"],"created_at":"2024-10-14T13:25:09.748Z","updated_at":"2025-04-12T21:08:19.078Z","avatar_url":"https://github.com/drmohundro.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Find-String\n\n[![Join the chat at https://gitter.im/drmohundro/Find-String](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/drmohundro/Find-String?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\nFind-String is a PowerShell script whose purpose is to emulate [grep](http://en.wikipedia.org/wiki/Grep) and/or [ack](http://beyondgrep.com/).\nPowerShell already has the built-in `Select-String` cmdlet, but this script wraps\n`Select-String` and provides match highlighting on top of the searching capabilities.\n\nIt currently highlights matches in a similar style to [ack](http://beyondgrep.com/).\n\n![screenshot](https://user-images.githubusercontent.com/43072/60065075-2051e200-96f2-11e9-90fe-97f2278942ff.png)\n\n## Examples\n\nFind all usages of `form` in all .cs files:\n\n```ps1\nfind-string form *.cs\n```\n\nFind the unique file extensions from all of the files that have the string\n'jquery' in them:\n\n```ps1\nfind-string jquery -passThru |\n    Select-Object -ExpandProperty Path |\n    Select-String '.\\.(\\w+)$' |\n    Select-Object -ExpandProperty Matches |\n    ForEach-Object { $_.Groups[1].Value } |\n    Select-Object -Unique\n```\n\nOr the same example using built-in aliases (more succinct, likely reflects more\ntypical usage):\n\n```ps1\nfind-string jquery -pass |\n    select -expand path |\n    select-string '.\\.(\\w+)$' |\n    select -expand matches |\n    %{ $_.groups[1].value } |\n    select -uniq\n```\n\n## Installation\n\n### PowerShell Gallery Install\n\nThis method of installation requires PowerShell v5 or higher.\n\n* Run `Install-Module Find-String`\n\nSee [Find-String on PowerShell Gallery](https://www.powershellgallery.com/packages/Find-String/).\n\n### PsGet Install\n\n* Install [PsGet](http://psget.net/)\n* Run `Install-Module Find-String`\n\nSee [Find-String on PsGet](http://psget.net/directory/Find-String/) for more details.\n\n### Manual Install\n\nClone (or download) the repository to:\n\n* If PowerShell 5\n    * `~/Documents/WindowsPowerShell/Modules/Find-String`\n* If PowerShell Core on Windows\n    * `~/Documents/PowerShell/Modules/Find-String`\n* If Mac/Linux\n    * `~/.local/share/powershell/Modules/Find-String`\n\n## Alternative Tools\n\nI like options, so I want to ensure everyone is aware of the other tools out there. My current preferred tool is RipGrep.\n\n* [Grep](https://www.gnu.org/software/grep/) - \"Grep searches one or more input files for lines containing a match to a specified pattern.\"\n* [Ack](https://github.com/beyondgrep/ack2) - \"ack is a code-searching tool, similar to grep but optimized for programmers searching large trees of source code.\"\n* [The Silver Searcher (aka AG)](https://github.com/ggreer/the_silver_searcher) - \"A code-searching tool similar to ack, but faster.\"\n* [The Platinum Searcher (aka PT)](https://github.com/monochromegane/the_platinum_searcher) - \"A code search tool similar to ack and the_silver_searcher(ag). It supports multi platforms and multi encodings.\"\n* [RipGrep (aka RG)](https://github.com/BurntSushi/ripgrep) - \"ripgrep recursively searches directories for a regex pattern\"\n\n## Editor Integration\n\n### Vim\n\nSee [find-string.vim](https://github.com/drmohundro/find-string.vim). Installation should be a simple `Plug 'drmohundro/find-string.vim'` if you use [vim-plug](https://github.com/junegunn/vim-plug).\n\n## Options\n\n* `-pattern`\n    * Specifies the text to find. Type a string or regular expression.\n    * Required\n* `-filter`\n    * Specifies the file types to search in. The default is all file types (\\*.\\*).\n* `-include`\n    * Specifies the file types to search in. This allows you to search across multiple file types (i.e. \\*.ps1,\\*.psm1).\n* `-excludeFiles`\n    * Specifies the file types to exclude from searches. If set, this overrides any global defaults or configuration.\n    * Comma-separated list of files to exclude from the search\n* `-excludeDirectories`\n    * Specifies the directories to exclude from searches. It really only makes sense for recursive searches. If set, this overrides any global defaults or configuration.\n    * Comma-separated list of directories to exclude from the search\n* `-path`\n    * Specifies the path to the files to be searched. Wildcards are permitted. The default location is the local directory.\n* `-recurse`\n    * Gets the items in the specified path and in all child directies. This is the default.\n* `-caseSensitive`\n    * Makes matches case-sensitive. By default, matches are not case-sensitive.\n* `-context`\n    * Captures the specified number of lines before and after the line with the match. This allows you to view the match in context.\n    * Example:\n        * `find-string foo *.cs -context 2,3`\n        * Would return a context of 2 lines before the match and 3 lines after the match\n* `-passThru`\n    * Passes the literal `MatchInfo` object representing the found match to the pipeline. By default, this cmdlet does not send anything through the object pipeline.\n    * This is useful if you wish to do additional processing on the results, such as collect any matches in a regular expression that you searched for or to gather unique results.\n* `-pipeOutput`\n    * Sends all output along the object pipeline. By default, this command uses color to help with readability; however, this prevents the output from being piped to another command. If you wish to pipe the output of this command to something else, be sure to use this parameter.\n    * This is useful if you wish to pipe the output to the clipboard.\n    * Example:\n        * `find-string foo *.cs -pipeOutput | clip`\n* `-listMatchesOnly`\n    * Returns all files that have matches existing in them, but doesn't display any of the matches themselves.\n\n\n## Changelog\n\nSee [CHANGELOG](CHANGELOG.md) for a list of all changes and their corresponding versions.\n\n## License\n\nFind-String is released under the MIT license. See [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrmohundro%2Ffind-string","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrmohundro%2Ffind-string","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrmohundro%2Ffind-string/lists"}