Coder Social home page Coder Social logo

slill / windows-grep Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 1.0 9.35 MB

Command line grep-like file search utility for Windows. Simple, fast, easy to use.

License: MIT License

C# 56.36% C++ 4.91% C 38.68% HTML 0.02% Hack 0.03%
grep-like windows search grep filemanagement filesearch textsearch

windows-grep's Introduction

Windows Grep logo

Windows Grep

CodeFactor .NET Core

Command line grep-like file search utility for Windows

Supports

- Basic and advanced file searching
- Regular Expressions
- Chained commands
- Filetype/Filepath/Filesize filtering
- Exports
- Mass replace and delete
- Ease of use: Runs from Command Line, Powershell, Windows Explorer or headless

INSTALLATION

  1. Visit the release tab (https://github.com/sLill/Windows-Grep/releases)
  2. Download and run WindowsGrepSetup.msi (This is the only file you need)

This will install Windows Grep in ProgramFilesx86, add "grep" to your system's PATH for command line use, and insert registry keys for context menu use within Windows Explorer directories.

USAGE

Right-click in File Explorer > Windows Grep

OR

Open cmd > "grep [command]"

REFERENCE

Recursive Search -r --recursive
Target Directory -d --directory=
Context Characters -c --context=
Limit n Results -n --results=
Suppress output -s --suppress
Ignore Line Breaks -b --ignore-breaks
Ignore Case -i --ignore-case
Target File -f --file=
Plain Text Search -F --fixed-strings
Regular Expression Search -G --basic-regexp
Filter Files by Type(s) [Inclusive] -t --filetype-filter=
Filter Files by Type(s) [Exclusive] -T --filetype-exclude-filter=
Filter Filepath(s) by Expression(s) [Inclusive] -p --path-filter=
Filter Filepath(s) by Expression(s) [Exclusive] -P --path-exclude-filter=
Filenames Only -k --filenames-only
FileSize Minimum -z --filesize-minimum=
FileSize Maximum -Z --filesize-maximum=
Write Output to File -w --write=
Replace Text -RX --replace=
Delete Files -DX --delete-files
File Hashes --hash= (0=SHA256, 1=MD5)

* See documentation for detailed command descriptions

Command Order
Order of flags and the search term is completely flexible


EXAMPLE COMMANDS

Recursive search.
-r Dug

Recursive search. ignore-case.
-r -i D[ui]g

Recursive search. txt and cs files only. Filter out bin and obj matches
-r Dug -t .txt;.cs -P bin;obj

Recursive search. show 100 characters around the match.
-r Dug -c 100

Recursive search. Filenames only. Additional search on results from first command for "Mike"
-r Dug -k | Mike

Match phone number
[+]?[(]?[0-9]{3}[)]?[-\s.]?[0-9]{3}[-\s.]?[0-9]{4,6}

Recursive search. US zipcode expression. Filter out .dll matches. Limit results 10. Write output to .csv
-r \d{5}(-\d{4})? -T .dll -n 10 -w 'C:\output.csv'

For even more examples and detailed descriptions of each flag, visit the wiki

windows-grep's People

Contributors

slill avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

7k8m

windows-grep's Issues

Add config file

  • Default search type: Regex vs Literal
  • Console log delay between matched items
  • Always show filesize

A (-b) bug

I found that on my device, in the very file test.txt, whose content is "abcd\r\nabcd", the (^) does not match the start of the second line and the ($) does not match the end of the first line.

It seems like "-b" command working (although I did not use it), so I tried adding "-b" to see what happens. On my device, "-b" prints it twice if a result doesn't appear in multiple lines.

image

image

Write flag

Not so much a bug as I never even started implementing it.

Increase user error message verbosity

Increase verbosity and readability on user errors

  • Missing search term
  • Missing command parameter
    -- and a couple more that I'm definitely forgetting

Build custom console

Windows console is pretty finicky at times when it comes to formatting. It might be worth it to just build a custom console window in Wpf.

Add move (-mv) flag

Add move flag (-mv) that takes a target directory as a single/double-quote encapsulated parameter

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.