KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
This is my try to do it Find all *.java files find . -name '*.java' Count lines wc -l Delete last line sed '$d' Use AWK to find max lines-count in wc output awk 'max=="" || data=="" || $1 > max {max=$1 ; data=$2} END{ print max " " data}' then merge it to single line find . -name '*.java' | xargs wc -l | sed '$d' | awk 'max=="" || data=="" || $1 > max {max=$1 ; data=$2} END{ print max " " data}' Can I somehow implement counting just non-blank lines?
Tags (comma-separated)
Save Edits
Cancel