* grep a string in different maps.
@ 2006-11-17 9:57 william.a.george
2006-11-17 21:02 ` martin
2006-11-18 1:12 ` Nelson Ferreira
0 siblings, 2 replies; 3+ messages in thread
From: william.a.george @ 2006-11-17 9:57 UTC (permalink / raw)
Hi.
I have a problem.
I'm using emacs on windows xp. I donwloaded some .exe file to be able
to run UNIX commands on window (it's called UnixUtils).
What I need to perform is to search for a string in files. Grep finds
the string if the files are in the same directory. But my problem is
that I want to perform this search on files that exist in other
directories.
A little description of my directory tree:
- SW (directory)
- logical (directory)
- terminal (directory)
- OS (directory)
If I'm standing in the terminal directory then it is OK to find a
string among the files in "terminal", but if I want to find the string
when I'm standing in "SW" then it not possible. Grep cannot recurse
through the directories.
I tried this combination also: find . -name * -exec grep -n string NUL
{}
And I got a negative result too.
Can someone please help me to find a way to solve my problem?
Thanks in advance.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: grep a string in different maps.
2006-11-17 9:57 grep a string in different maps william.a.george
@ 2006-11-17 21:02 ` martin
2006-11-18 1:12 ` Nelson Ferreira
1 sibling, 0 replies; 3+ messages in thread
From: martin @ 2006-11-17 21:02 UTC (permalink / raw)
>>>>> william a george <william.a.george@gmail.com> writes:
> Date: 17 Nov 2006 01:57:38 -0800
>
> Hi.
> I have a problem.
> I'm using emacs on windows xp. I donwloaded some .exe file to be able
> to run UNIX commands on window (it's called UnixUtils).
> What I need to perform is to search for a string in files. Grep finds
> the string if the files are in the same directory. But my problem is
> that I want to perform this search on files that exist in other
> directories.
> A little description of my directory tree:
> - SW (directory)
> - logical (directory)
> - terminal (directory)
> - OS (directory)
> If I'm standing in the terminal directory then it is OK to find a
> string among the files in "terminal", but if I want to find the string
> when I'm standing in "SW" then it not possible. Grep cannot recurse
> through the directories.
> I tried this combination also: find . -name * -exec grep -n string NUL
> {}
> And I got a negative result too.
Hi,
how was the result negative ?
I presume, you supplied the above command line by executing
"grep-find".
Provide the find command with your "root" directory "SW (directory)"
instead of "." and surround the wild card * with double quotes.
(find <directory> -name "*" -exec grep -n <string> {} NUL \;)
Martin
--
parozusa at web dot de
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: grep a string in different maps.
2006-11-17 9:57 grep a string in different maps william.a.george
2006-11-17 21:02 ` martin
@ 2006-11-18 1:12 ` Nelson Ferreira
1 sibling, 0 replies; 3+ messages in thread
From: Nelson Ferreira @ 2006-11-18 1:12 UTC (permalink / raw)
"william" == william a george <william.a.george@gmail.com> escreveu:
[...]
william> If I'm standing in the terminal directory then it is OK to find a
william> string among the files in "terminal", but if I want to find the string
william> when I'm standing in "SW" then it not possible. Grep cannot recurse
william> through the directories.
william> I tried this combination also: find . -name * -exec grep -n string NUL
william> {}
william> And I got a negative result too.
william> Can someone please help me to find a way to solve my problem?
In my setup, GNU grep supports the -r switch which does allow for
recursion.
I use it by M-x grep RET grep -rin string . RET
--
Nelson Ferreira
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-11-18 1:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-17 9:57 grep a string in different maps william.a.george
2006-11-17 21:02 ` martin
2006-11-18 1:12 ` Nelson Ferreira
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).