Just as you can run a compiler from Emacs and then visit the lines
where there were compilation errors, you can also run
then visit the lines on which matches were found. This works by
treating the matches reported by
grep as if they were "errors."
To do this, type M-x grep, then enter a command line that
specifies how to run
grep. Use the same arguments you would give
grep when running it normally: a
(usually in single-quotes to quote the shell's special characters)
followed by file names, which may use wildcards. The output from
grep goes in the `*grep*' buffer. You can find the
corresponding lines in the original files using C-x ` and
RET, as with compilation errors.
If you specify a prefix argument for M-x grep, it figures out
the tag (see section Tags Tables) around point, and puts that into the default
The command M-x grep-find is similar to M-x grep, but it
supplies a different initial default for the command--one that runs
grep, so as to search every file in a
directory tree. See also the
in section Dired and
Go to the first, previous, next, last section, table of contents.