Skip to content

kronnor919/minigrep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minigrep

Minigrep is a basic implementation in Rust of the Linux utility grep.

Usage

minigrep word ~/path/to/file.txt

minigrep "pub struct" ~/path/to/file.rs

In the output, you will see the lines where the requested text appears.

Case sensitive

By default, Minigrep will distinguish between uppercase and lowercase letters. If you don't want this, you can create the IGNORE_CASE environment variable; the value doesn't matter, it's enough that it exists.

# Linux
export IGNORE_CASE=1

Installation

Via curl

Run:

curl -sL https://raw.githubusercontent.com/kronnor919/minigrep/main/install.sh | sudo bash

Manual

  • Go to the latest release on GitHub
  • Scroll to the bottom
  • Download the .tar.gz
  • Unzip it using: tar -xzf <filename>
  • Move it to a location recognized by the PATH. Example: sudo mv <binary> /usr/local/bin/
  • Test it with minigrep --version