Thursday, June 9, 2011

Recursive wc on a tree of files

Here's how to get the total line count for a tree of files in .

find foldername/ -type f -exec wc -l {} +

The '+' is the key bit, versus '\;' which I think tries to send them one-at-a-time.  Done with cygwin in a windows shell.

1 comment:

  1. The {} + are args to exec; the -l is a wc option. Also used: "find -type f -name *.ext -exec dos2unix {} +"

    ReplyDelete