|
Software
»
Gnu
»
Gnu - Grep
feature suggestion - exclude count of files with 0 matches
View:
Threaded
Chronologically
All Messages
New views
1 Messages —
Rating Filter:
0
1
2
3
4
5
Alert me
feature suggestion - exclude count of files with 0 matches
by ciaranpower
:: Rate this Message:
Reply to Author
|
View Threaded
|
Show Only this Message
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
LightInTheBox
- Buy quality products at
wholesale
price!
Free Forum
Powered by Nabble
Forum Help