2010-12-29 1 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 wc : grep "regexp" * | wc -l

관련 문제