Skip to content

Instantly share code, notes, and snippets.

@Pablo-Merino
Created March 10, 2012 12:23
Show Gist options
  • Save Pablo-Merino/2011286 to your computer and use it in GitHub Desktop.
Save Pablo-Merino/2011286 to your computer and use it in GitHub Desktop.
Script to count the line numbers of all the files in the actual dir
total = 0
Dir["./**/*.*"].each do |f|
filenumber =%x{wc -l #{f}}.split.first
puts f+ " - "+count = filenumber
total = total + filenumber.to_i
end
puts "Total lines = #{total}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment