Subject: | |
From: | |
Reply To: | |
Date: | Fri, 20 Nov 1998 12:17:17 -0500 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Thanks Mark! That did the trick!
John
At 11/20/98 12:06 PM , you wrote:
>John Korb writes:
>> I'm trying to do a "grep" on all files in a particular directory and all
>> its subdirectories and I'm running into some problems. Perhaps one of the
>> POSIX gurus knows a solution. Here is what I have tried (and what I've
>> learned):
>
>...deletia...
>
>> o I know that "ls -Rx1 /COMM/DOC/html" will generate a list of files
>> in the directory and its subdirectories, but it doesn't produce a
>> list of "fully-qualified" file names. Instead, it lists the directory
>> name and then lists the files in that directory, then a blank line,
>> then the next directory name, then the list of files in that directory,
>> etc. This is not suitable for "xargs" and "grep".
>>
>> Okay, what am I overlooking? How can I get "ls" to give me the kind of
>> file listing that the "listfile,6" command (above) gives me (or is there a
>> different command I should be using)?
>
>You want to use "find" instead of "ls":
>
> find /COMM/DOC/html -type f | xargs grep searchstring
>
>The -type f says to return just files; the default is files *and*
directories.
>--
>Mark Bixby E-mail: [log in to unmask]
>Coast Community College Dist. Web: http://www.cccd.edu/~markb/
>District Information Services 1370 Adams Ave, Costa Mesa, CA, USA
92626-5429
>Technical Support Voice: +1 714 438-4647
>"You can tune a file system, but you can't tune a fish." - tunefs(1M)
>
--------------------------------------------------------------
John Korb email: [log in to unmask]
Innovative Software Solutions, Inc.
The thoughts, comments, and opinions expressed herein are mine
and do not reflect those of my employer(s), or anyone else.
|
|
|