I was trying to use sed to count all the lines based on a particular extension.
find -name \'*.m\' -exec wc -l {} \\; | sed ...
I was tryi
For big directories we should use:
find . -type f -name '*.m' -exec sed -n '$=' '{}' + 2>/dev/null | awk '{ total+=$1 }END{print total}' # alternative using awk twice find . -type f -name '*.m' -exec awk 'END {print NR}' '{}' + 2>/dev/null | awk '{ total+=$1 }END{print total}'