A command line program similar to grep/ripgrep. Taught as a mini project in chapter 12 of the official rust book.
Basically it lets you search for all lines within a text file that contain a particular string(query).
-
Clone this repository:-
git clone https://github.com/xoldyckk/minigrep.git -
Change directory of your terminal into the cloned project folder.
cd ./minigrep -
Run the following command:-
cargo run -- <query> <path_to_text_file>where
<query>is the string which you want to search for and<path_to_text_file>is path to the text file you want to search thequeryin for.Optionally, if you want the search to be case insensitive provide an environment variable named
IGNORE_CASElike this:-IGNORE_CASE=1 cargo run --<query> <path_to_text_file>