find monthly_reports/ -iname '*.csv' \
| xargs -n 1 wc -l \
| cut -d' ' -f1 \
| (SUM=0; while read NUM; do SUM=$(($SUM+$NUM)); done; echo $SUM)
PROBLEM: this has trouble if file names have spaces in them.
To find out how many lines in total are contained in a subdirectory of
files, there is the "Wc" command, which is a recursive version of "wc"
Wc -l monthly_reports/*/*.csv
-l specifies count the lines
No comments:
Post a Comment