(no title)
thelastnode | 14 years ago
The {} means "replace with filename" and the semicolon (escaped so your shell doesn't eat it). This will run wc -l <filename> for every file that matches.
The -regex flag lets you do the same thing as -name with regular expressions.
The problem with this is we run n different wc's, as opposed to just one with all the parameters. We can use xargs to fix this: find . -name .java | xargs wc -l
This even gives you a total!
The really* simple solution (which is probably best) is to just use shell globbing: wc -l *.java
While find and xargs are definitely useful, the easy solution here works better
sirn|14 years ago
jedbrown|14 years ago