3 ms·
That has different semantics (it prints one line per file) and can have line length limitations. This has the same semantics as the parent's version, but withou
by jedbrown 15y ago
That has different semantics (it prints one line per file) and can have line length limitations. This has the same semantics as the parent's version, but without line length issues.
find . -name \*.java -exec cat {} + | wc -l
- X-Istence 15y agoNote that the + may not be portable. I know it doesn't work on older Solaris versions (<10) and HP-UX (from a couple years ago when I last touched it). Also, find may or may not split the files it finds into multiple invocations.
- Karellen 15y agoToo many invocations of "cat" find . -name \*.java -print0 | xargs -0 cat | wc -l Edit: Dammit. Others have already posted this exact version further below. :-(