とても便利な ack - grep-like なテキストファインダー -

使用例はこんな感じ.

[training@localhost mobasif]$ ack IS_SMART_PROCESS ./
pm/Page/Sample.pm
18: if ($_::IS_SMART_PROCESS) {

pm/Drobow/HttpResponse.pm
15: if ($options->{for_smartphone} && $_::IS_SMART_PROCESS) {

pm/Shout/HttpResponse.pm
15: if ($options->{for_smartphone} && $_::IS_SMART_PROCESS) {


以下man ackの内容(最初の方だけ抜粋).
一部訳しましたが, 意味がないことに気づき途中でやめました(爆)

NAME
ack - grep-like text finder

SYNOPSIS
ack [options] PATTERN [FILE...]
ack -f [options] [DIRECTORY...]

DESCRIPTION
grep で行なっていた 99 %を ack で置換できます.

Ack は指定したファイルの中から指定したパターンがある行を検索します.

FILE SELECTION
ack is intelligent about the files it searches. It knows about certain file types, based on both the extension on the
file and, in some cases, the contents of the file. These selections can be made with the --type option.

With no file selections, ack only searches files of types that it recognizes. If you have a file called foo.wango, and
ack doesn’t know what a .wango file is, ack won’t search it.

The -a option tells ack to select all files, regardless of type.

Some files will never be selected by ack, even with -a, including:

* Backup files: Files matching #*# or ending with ~.
* Coredumps: Files matching core.\d+

However, ack always searches the files given on the command line, no matter what type. Furthermore, by specifying the -u
option all files will be searched.

DIRECTORY SELECTION
ack descends through the directory tree of the starting directories specified. However, it will ignore the shadow
directories used by many version control systems, and the build directories used by the Perl MakeMaker system. You may
add or remove a directory from this list with the --[no]ignore-dir option. The option may be repeated to add/remove mul-
tiple directories from the ignore list.

For a complete list of directories that do not get searched, run ack --help.

WHEN TO USE GREP
ack trumps grep as an everyday tool 99% of the time, but don’t throw grep away, because there are times you’ll still
need it.

E.g., searching through huge files looking for regexes that can be expressed with grep syntax should be quicker with
grep.

If your script or parent program uses grep "--quiet" or "--silent" or needs exit 2 on IO error, use grep.

OPTIONS
-a, --all
Operate on all files, regardless of type (but still skip directories like blib, CVS, etc.)

-A NUM, --after-context=NUM
Print NUM lines of trailing context after matching lines.

-B NUM, --before-context=NUM
Print NUM lines of leading context before matching lines.

-C [NUM], --context[=NUM]
Print NUM lines (default 2) of context around matching lines.

-c, --count
Suppress normal output; instead print a count of matching lines for each input file. If -l is in effect, it will
only show the number of lines for each file that has lines matching. Without -l, some line counts may be zeroes.

If combined with -h (--no-filename) ack outputs only one total count.

--color, --nocolor
--color highlights the matching text. --nocolor supresses the color. This is on by default unless the output is
redirected.

On Windows, this option is off by default unless the Win32::Console::ANSI module is installed or the
"ACK_PAGER_COLOR" environment variable is used.

--color-filename=color
Sets the color to be used for filenames.

--color-match=color
Sets the color to be used for matches.


....

Ref.
http://www.glidenote.com/archives/1437