2010-12-29 15 views

答えて

1

のgrepはそれを行うことができるかどうかはわからないが、それはAWKで行うのは簡単だ:

 
grep -c foo * | awk -F: '{sum += $2} END {print sum}' 

0

how about

cat * | grep -c regexp

You'll probably get 'xxx is a directory' and similar warnings to stderr unless you use some flag to suppress them, but the count seems to work.

1

You can use wcgrep "regexp" * | wc -l

関連する問題