đȘ Bringing Unix power to Windowsâno terminal required.
If youâve ever used the grep command in Unix or Linux, you know how powerful it is for searching through text files. But for everyday Windows usersâor even devs who prefer a GUIâthere hasnât been a satisfying, native alternative. Thatâs what inspired me to create WinFindGrep, an open-source, grep-style search and replace tool built with .NET 9.0 and Windows Forms.
đ What is WinFindGrep?
WinFindGrep is a lightweight desktop utility that lets you search for text across multiple directories and file types. It offers:
- Recursive search through multiple folders
-
File filters (e.g.,
*.txt,*.cs,*.xml) - Regex support, case sensitivity, whole-word matching
- Optional find-and-replace across multiple files
- Results with file path, line number, and preview
- Double-click a result to open the file at the match
-
No installationâjust run the standalone
.exe
Demo & Downloads:
đ https://valginer0.github.io/WinFindGrepWebsite/
đŸ GitHub: https://github.com/valginer0/WinFindGrep
âïž How Itâs Built
This project uses:
- .NET 9.0 â the latest runtime for modern Windows desktop apps
- Windows Forms â for rapid UI development and a familiar UX
- C# â with regex support, stream readers, and text manipulation
The solution is structured cleanly:
đ Forms/ # UI components
đ Services/ # Search, replace, and file-system logic
đ Models/ # Data structures
File Collection Logic
For file collection, I call Directory.GetFiles() with recursive logic to handle user-selected folders and file-type filters. This approach lets me:
-
Follow subdirectories via
SearchOption.AllDirectories -
Filter by extension (e.g.,
*.cs,*.xml,*.txt) - Process each folder independently according to user input
While Directory.GetFiles() works well for most scenarios, it loads all matches into memory at once, which can limit scalability on very large datasets. Future optimizations may include:
- Switching to
Directory.EnumerateFiles()for a streaming approach - Using
EnumerationOptionsto explicitly include/exclude hidden or system files - Manually checking
File.GetAttributes()for fine-grained control
đŠ Self-Contained Deployment
Thanks to modern .NET tooling, WinFindGrep ships as a single-file, self-contained executable:
dotnet publish -r win-x64 --self-contained true -p:PublishSingleFile=true -p:PublishTrimmed=true
Outcome:
â No .NET runtime required on the userâs PC
â No installerâjust download and run
â Easy to distribute via GitHub Releases, email, or USB
đ§ Lessons Learned
GUI isnât deadâmany Windows users still prefer click-to-use tools.
GetFiles() vs. EnumerateFiles(): streaming APIs scale better for huge data sets.
EnumerationOptions is handy when you need explicit control over hidden/system files.
A clear project structure (Forms/, Services/, Models/) pays off in long-term maintainability.
đ Try It and Share Feedback
If youâre on Windows and need a powerful, grep-inspired tool that runs without installation, give WinFindGrep a spin:
đ https://valginer0.github.io/WinFindGrepWebsite/
đ» https://github.com/valginer0/WinFindGrep
Bug reports, feature ideas, and pull requests are very welcome. Thanks for readingâfollow me for more .NET desktop tips and dev-tool deep dives! đ
Top comments (0)