Find your fat modules
find /path/to/src -name "*.m" | awk ' { print "\""$0"\"" } ' | xargs wc -l | sort
Change "*.m" with your language extension: rb, java, cpp, etc.
Written by AlexDenisov
Related protips
5 Responses
You forgot -n
flag in sort
Also for Git projects you can use:
git ls-files '*.m' | xargs wc -lm | sort -n
over 1 year ago
·
@hauleth, it works for me without -n
. OS X 10.8
over 1 year ago
·
For a Rails project in Ubuntu:
find app/models/ -name "*.rb" | awk ' { print "\""$0"\"" } ' | xargs wc -l | sort -n
over 1 year ago
·
Can someone help understand how these piped commands work? What does each command do.
over 1 year ago
·
@vohof: find
look for all files that ends with .m
, then awk
wraps each line (found file) with "
(quotes), count lines, and sort by it.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Module
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#