Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About the project:

# 🕵️‍♂️ minigrep

**minigrep** is a simple command-line tool written in **Rust** that lets you search for substrings in a file — inspired by the classic `grep`.

## 📦 Features

- 🔍 Search for any substring in a file
- ⚡ Fast and lightweight (thanks to Rust!)
- 📁 Read from files passed via command line
- 🧵 Case-insensitive search (via env var)

Example:

cargo run -- body poem.txt > output.txt 

This will print all lines in poem.txt that contain the word "body".


Case-Insensitive Search

To enable case-insensitive search, set the environment variable:

IGNORE_CASE=1 cargo run -- BODY poem.txt > output.txt  

🛠 Installation

  1. Make sure you have Rust installed.
  2. Clone the repo:
git clone https://github.com/piyush-itis/minigrep.git
cd minigrep
cargo build --release
  1. Run it:
cargo run -- "your-query" "your-file.txt"

🧠 Inspiration

This project is inspired by The Rust Programming Language Book, specifically the minigrep mini-project.


📜 License

MIT


🙌 Contributions

PRs welcome! Feel free to fork, enhance, and contribute.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages