Skip to content

alejandromc23/multigrep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multigrep

Multigrep is a Rust program that allows searching for queries and regex patterns in utf-8 encoded files. It can search for the queries in a specific file or folder recursively.

Screenshot 1

Prerequisites

To build and use Multigrep, you'll need to have the following installed on your system:

  • Rust 1.51 or higher
  • Git

Installation

To install Multigrep, follow these steps:

  1. Clone the Git repository:
git clone https://github.com/alejandromc23/multigrep.git
cd multigrep
  1. Build the program using the included build.sh script:
./build.sh

This will compile the program and install it to your system's /usr/local/bin directory. You may be prompted to enter your password to authorize the installation.

Features

Multigrep has the following features:

  • Search for one or more queries or regex patterns in utf-8 encoded files
  • Search in a specific file or folder recursively
  • Highlight matches in a different color for each query or pattern
  • Show the line number of each match
  • Ignore case when searching

Output

When you run Multigrep, it will show a list of the queries to localize, with each query highlighted in a random color. Then, for each file that contains a match, it will display the file name and all the lines that have a match, with the query matched highlighted in the color shown in the initial list.

Multigrep will keep searching until it has read all the files in the specified directory and its subdirectories.

Examples

Here are some examples of how to use Multigrep:

Search for multiple queries

multigrep --query "foo" "bar" --path "/path/to/files"

Search for regex patterns

multigrep --regexp "foo.+bar" "ap\S*\(" --path "/path/to/files"

Search for a queries, regex and show the line number of the matches

multigrep --query "foo" "bar" --regexp "foo.+bar" --path "/path/to/files" --number-line

License

This project is licensed under the MIT License. See LICENSE for more information.

Contributing

Contributions are welcome! Please feel free to submit issues or pull requests

About

A simple command-line tool written in Rust that helps you localize queries in files by displaying which files and lines have generated the given queries.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors