Powertoys: Grep for Windows

Created on 6 Jan 2020  路  9Comments  路  Source: microsoft/PowerToys

It would be great if PowerToys can include a tool to grep files such as GrepWin having a context menu option to Grep files in the selected folders.

Idea-New PowerToy

Most helpful comment

If we're going to do this I vote it should be powered by ripgrep

All 9 comments

If we're going to do this I vote it should be powered by ripgrep

You just use PowerShell :)

gci -Recurse | sls <you regex pattern>

It seems that gci just searches file names. The idea is to be able to search file contents using regular search and regex through a graphical user interface.

you should try it before comment. But powertoys deserves a GUI tool like this, because not all users are comfortable with command line.

I've been thinking a bit about this, but currently have only more questions:

  • Could it be based on top of an existing command-line exe? (The basics may work but getting progress--i.e. not having to wait for it to finish--may be harder.)
  • As grep is available in WSL(2) could it sit on top of that? (Although I don't know if wanting a dependency on WSL is desirable)
  • Grep has lots of options and I haven't seen any existing apps do a good job of exposing all the options in a clean and easy-to-use way. Are all options needed? (At least in a first version.)
  • Would starting with a pared-back (limited) set of options be acceptable? (And if so, which options are the minimum required?)
  • What shell integration is required? (Just an additional context menu entry in explorer, or anything more?)
  • If this brings grep support to windows, should it also support operation from the command-line and the same command-line switches as the *NIX version? (and if so, should the exe be called 'grep' or something else, or something else and also have an additional alias to 'grep.exe'?)
  • Definitely it could be based on an existing command-line tool. No need to reinvent the wheel.
  • Depending on WSL can be a way to do it but it would be better if there is another way to implement it without having to depend on WSL. How about reusing the regex engine built-into VS Code and exposing it more in a GUI way?
  • I rarely use advanced features of Grep, at least when searching for text or patterns in a set of files. I usually right-click on a folder and launch a GUI tool that lets me search for text or basic regex having the option to include and exclude files. So, I guess for a first version, basic options would be very helpful. More options can be added later when the need arises.
  • A limited set of options will be very helpful. Some of the great options would be searching using text(case sensitive vs case insensitive) or regex, include and exclude files and folders (probably using a graphical tree at first and adding an option to use regex later), an option to look into subfolders enabled by default, filtering by file size (usually to discard huge files) and filtering by date (before, after or between a date range).
  • In my opinion, a context-menu option will do the job
  • If we are looking into porting grep to Windows, it would be good to have a seamless experience starting from having a command-line tool called "grep" which would accept the same switches as the original yielding the same results. Although, I am not sure if there is a need to port it.

iirc the VSCode engine is ripgrep

iirc the VSCode engine is ripgrep

VSCode doesn't show any indication of [currently] taking a dependency on ripgrep and includes its own, simple grep method that while basic is enough for their needs.

https://github.com/microsoft/PowerToys/issues/6388#issue-693491250 asks if this is the same as PowerRename?

It's not.

This is about having a separate tool that can be used to search within files. It's a UI on top of a grep utility (similar to FINDSTR).
Think of it as "Find in files" but as a standalone tool.
As linked above, there are some 3rd party tools that already provide this functionality but these are often available from questionable sources, are not clearly maintained, and have out-dated UIs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Martin-Hausleitner picture Martin-Hausleitner  路  3Comments

anish-94 picture anish-94  路  3Comments

patware picture patware  路  3Comments

SWinxy picture SWinxy  路  3Comments

niels9001 picture niels9001  路  3Comments