Skip to content
/ minigrep Public

Simple program for searching text patterns in the file system

Notifications You must be signed in to change notification settings

nyr24/minigrep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minigrep

This is a simple program for searching text in a file system
Famous grep command was taken as inspiration

It can search files recursively, output line numbers, output whole result into a file you provided, etc.
All utf-8 codepoints are supported, you can search for Chinese or Cyrillic characters freely

Example of usage:

minigrep [options] -s $pattern -p $filepath [-f $output_to_file_path] [-e .git,.png,.exe]

options are:

  • -h -- provide information about usage of the program
  • -q -- make program quiet, error logs would not be displayed, highly recommended
  • -d -- search a directory starting from $filepath (by default program expect a file)
  • -r -- do recursive search starting from $filepath
  • -i -- ignore case in $pattern and occurences
  • -n -- output line numbers

optional arguments that accept an argument:

  • -f -- write all program output to the file, instead of standart output: -f $output_to_file_path
  • -e -- exclude searching from paths which contain patterns: -e .git,.png,.exe

About

Simple program for searching text patterns in the file system

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages