🪟 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
EnumerationOptions
to 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)