Skip to content
Notifications You must be signed in to change notification settings

arjav0703/grep-rust

Repository files navigation

Grep

This project is a simple implementation of the grep command in Rust. It allows you to search for a specific pattern in a file and print the lines that contain the pattern.

Installation

  1. make sure you have Rust installed on your machine. If you don't have it yet, you can install it from here.
  2. Use cargo to install:
cargo install grep-rust-simple
  1. Run the program using:
grep-rust-simple -E "pattern" filename # replace "pattern" and "filename" with your desired values

Build and Run Locally

  1. Make sure you have Rust installed on your machine. If you don't have it yet, you can install it from here.

  2. Clone the repository:

git clone https://github.com/arjav0703/grep-rust.git
  1. Navigate to the project directory:
cd grep-rust
  1. To use the program, run the following command:
cargo run -- -E "pattern" filename

Features:

  • Prints lines that match the given pattern.
  • Support advanced regex patterns like \d, \w, etc.