The UNIX and Linux Forums
>
Top Forums
>
UNIX for Dummies Questions & Answers
recursive wc on a directory?
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
recursive wc on a directory?
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
7
(
permalink
)
06-19-2009
pludi
Moderator
Join Date: Dec 2008
Location: .at
Posts: 1,934
Simple and fast:
Code:
find /topleveldirectory/ -type f -exec wc -l {} \; | awk '{total += $1} END{print total}'
No loops, no whitespace problems, no unnecessary cat
pludi
View Public Profile
Find all posts by pludi
Find pludi's past nominations received
Find pludi's present nominations given