While grep
is a powerful command line tool, it is difficult to use
So for the convenient of human being, we need a more smart
tool to do our work.
happygrep
is a small and nice grep
front-end based on ncursesw
TUI.
Its internal command is grep
used to find all the matching text line
containing specific strings, then displaying them in the ncursesw
window.
So you can view the results with ease.
Since the application is dependent on ncursesw
library, so we need to
install the library firstly, otherwise it can't be compiled successfully :
sudo apt-get install libncursesw5 libncursesw5-dev
This will get you going with the latest version of happygrep
and make it
easy to fork and contribute any changes back upstream.
-
Check out the code
$ git clone git://github.com/happygrep/happygrep.git
-
Then compile and install it.
$ cd ~/happypeter/ $ make $ sudo make install
By default, happygrep skips the .git
directory, and it supports regular
expression, it is grep
Anyway. In addition, happygrep
can specify one
directory to ignore. The directory name can use regex.
For instance, we want to search the string hello world
in a gitrepository called
techdoc`, we can do like this:
happygrep "hello world"
Also, you can ignore a directory named image/
:
happygrep "hello world" "image"
After running the commands above respectively, then you will get a nice window based text user interface.
-
use
j
andk
(or up/down arrows) to select the entry listed in window -
type
e
character to open the file where the proper entry appeared -
edit the opened file in
vim
editor -
close
vim
to return to the original window to continue -
type
q
character to quit
Please feel free to submit pull requests and file bugs on the issue tracker.
(The MIT license)
Copyright (c) 2011 happpypeter