4 ms·
A one liner for recursive line counts (explicitly allowing certain extensions): find . -regex ".*\.\(js\|py\|rb\|php\|html\)" | xargs wc -l
by tlrobinson 19y ago
A one liner for recursive line counts (explicitly allowing certain extensions):
find . -regex ".*\.\(js\|py\|rb\|php\|html\)" | xargs wc -l
- foonamefoo 19y agoit is a shame that find . -name "*{js,py,rb,php,html}" | xargs wc -l I guess {} globbing is bash specific?
- deleted 19y ago[deleted]
- nostrademons 19y agoYou can also exclude certain file patterns by throwing in a grep -v or two, eg. my command for counting JavaScript lines and excluding 3rd-party libraries is: find . -name "*.js" | grep -v jquery | xargs wc -l