bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature suggestion - exclude count of files with 0 matches


From: ciaranpower
Subject: feature suggestion - exclude count of files with 0 matches
Date: Sun, 22 Jun 2008 02:33:59 +0100
User-agent: KMail/1.9.9

Hi,

I often find myself looking for an ordered count of the number of files 
matching a pattern in a directory e.g.

grep -cr pattern . | sed '/:0$/d' | sort -k2n -t:

The 'sed' removes files with 0 matches (which I'm not interested in) e.g.
foo:0

As I'm sure I'm not the only one doing this:
how about an option (maybe -N?) to exclude files with 0 matches from output?

Thanks,
Ciaran




reply via email to

[Prev in Thread] Current Thread [Next in Thread]