Can someone give me a simple shell script that search for a specific
string in all files ?
Same as MS Windows' "Search/Find in file" functionality.
Regards,
Elias
find / -type f | xargs grep "specific string" /dev/null | less
--
JP
While not a bad answer, it's incomplete and not efficient. I have a more complete
answer at http://www.aplawrence.com/SCOFAQ/scotec6.html#recursivegrep which
includes a nice Perl script from Bill Campbell and John Dubois' advise on
Glimpse.
--
to...@aplawrence.com Unix/Linux/Mac OS X resources: http://aplawrence.com
Get paid for writing about tech: http://aplawrence.com/publish.html
can you dissect and explain it please ?
Elias
Perhaps you have noticed another thread over the last four or five
days, in this newsgroup, regarding "Merge", where Tony and Bela and
I have pointed out that it is necessary to provide some context in
Usenet messages.
If you want me to explain "it", then you must tell me what "it" is.
While I pride myself on having a pretty decent memory, nothing requires
me to remember what sort of "it" I may have provided yesterday, or last
week, or last month.
It is *your* responsibilty to provide some some context, which is
satisfied by (minimal, please!) quoting of prior messages. Neither I
nor anyone else is being paid to dig through prior postings to find out
what was said in them.
As it is, your message is floating around with no references, no quotes,
no anchor, no context; it is a waste of bytes and a waste of time.
--
JP
You have a point....
Now I realized that your news reader doesn't show you the messages in a tree
like structure, if that wasn't the case then you could have just see your
previous post and my original post just below each other. (same as Google
Groups display)
The 'it' referes to this expression:
find / -type f | xargs grep "specific string" /dev/null | less
But nevermind though, I figured it out.
Regards,
Elias
>You have a point....
>Now I realized that your news reader doesn't show you the messages in a tree
>like structure, if that wasn't the case then you could have just see your
>previous post and my original post just below each other. (same as Google
>Groups display)
AAARGH!
No. That is NOT NECESSARILY TRUE.
First: News articles expire. With the advent of very large hard drives,
servers keep articles around longer than they used to, but you
cannot assume that anyone has a particular message.
Second: News articles get to servers late, out of sequence and sometimes
never at all. News is much faster and more reliable than it ever was,
but you cannot assume that anyone has a specific message or that the
messages are in the same order you see them.
Third: Some people read News by email gateways or other indirect means.
Everything above applies to them in spades.
We all have different views of the world. Nowhere is that more true than
in the world of News.
You're wrong. I get the newsgroup as email, and since I use mutt, I
assuredly see messages in a tree-like structure. But I delete most of
them after I've read them.
--
JP
Actually, I occassionally, hopefully get paid to "dig through prior
postings" :)
I tell clients comp.unix.sco.misc is my biggest trade secret. I even give
them the link and show them how to look. Fortunately most still hire me to
read it for them.