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 thequery
in for.Optionally, if you want the search to be case insensitive provide an environment variable named
IGNORE_CASE
like this:-IGNORE_CASE=1 cargo run --<query> <path_to_text_file>