[SLUG] grep

john at johnallsopp.co.uk john at johnallsopp.co.uk
Fri Mar 31 14:57:21 BST 2006


> On Fri, Mar 31, 2006 at 08:17:20AM BST, Stephen O'Neill wrote:
>> john at johnallsopp.co.uk wrote:
>>
>> >How do I get it just to print the matching file names and the
>> count?
>> >
>>
>> That's frustrating, I'm sure I've asked the exact same question and
>> solved it before. However I'm sat on a windows box with no cygwin
>> and
>> not the machine I did it on.
>>
>> However, my initial thoughts are to pipe that to another grep that
>> excludes ":0$" or however the count is output.
>
> Does:
>
> $ grep -c "thingy" * | grep :[1-9]
>
> do what you want?
>
> Al

Yes, thank-you. I didn't expect that though but it makes sense.

Cheers
J




More information about the Scarborough mailing list