Mini Grep
Write your own grep from scratch in modern C++ with zero external dependencies. You parse command-line flags, scan files or standard input line by line, match a pattern, and print results with optional line numbers and context. A practical project for command-line tooling and text search.
Support Free C++ Education
Help us keep this platform free for everyone! Your support enables us to create more high-quality lessons, exercises, and interactive content.
What You'll Build
A command-line search tool that finds a pattern across one or more files or piped input, with flags for case-insensitive matching, line numbers, inverted matches, and recursive directory search.
Learning Objectives
- Parse argc and argv into flags and positional arguments
- Read files and standard input uniformly with std::istream
- Match lines against a pattern with std::regex or literal search
- Implement case-insensitive and inverted matching options
- Walk directory trees recursively with std::filesystem
- Print matches with filenames, line numbers, and context lines
- Return meaningful exit codes to compose with other tools
Coming Soon
This project is in development. Register your interest and we'll email you the moment it goes live.
No spam. Unsubscribe anytime.
Coming Soon
This project is in development. Register your interest and we'll email you the moment it goes live.
No spam. Unsubscribe anytime.