I've added a git alias to give me the line counts of specific files in my history:[alias]lines = !lc() { git ls-files -z ${1} | xargs -0 wc -l; }; lcHowever, wc -l is reporting multiple totals, such that if I have more than ~100k lines, it reports the total for them, then moves on. Here's an example:<100k lines (desired output)$ git lines \*.xslt  46 packages/NUnit-2.5.10.11092/doc/files/Summary.xslt 232 packages/NUnit-2.5.10.11092/samples/csharp/_UpgradeReport_Files/UpgradeReport.xslt 278 total>100k lines (had to pipe to grep total)$ git lines \*.cs | grep total 123569 total 107700 total 134796 total 111411 total  44600 totalHow do I get a true total from wc -l, not a series of subtotals?
How do I get a single total of lines with `wc -l`?
files;xargs;wc
Try this, and apologies for being obvious:cat *.cs | wc -lor, with git:git ls-files -z ${1} | xargs -0 cat | wc -lIf you actually want the output to look like wc output, with both individual counts and a sum, you could use awk to add up the individual lines:git ls-files -z ${1} | xargs -0 wc -l |awk '/^[[:space:]]*[[:digit:]]+[[:space:]]+total$/{next}     {total+=$1;print}     END {print total,total}'That won't be lined up as nicely as wc does it, in case that matters to you. To do that, you'd need to read the entire input and save it, computing the total, and then use the total to compute the field width before using that field width to print a formatted output of the remembered lines. Like home renovation projects, awk scripts are never ever really finished.(Note to enthusiastic editors: the regular expression in the first awk condition is in case there is a file whose name starts with total and a space; otherwise, the condition could have been the much simpler $2 == total.)