Skip to content

Instantly share code, notes, and snippets.

@nlively
Created April 5, 2012 19:02
Show Gist options
  • Save nlively/2313259 to your computer and use it in GitHub Desktop.
Save nlively/2313259 to your computer and use it in GitHub Desktop.
Count lines of code in a rails project
#!/bin/bash
find . \( -iname '*.rb' -o -iname '*.css' -o -iname '*.js' -o -iname '*.erb' -o -iname '*.html' -o -iname '*.haml' -o -iname '*.scss' -o -iname '*.coffee' \) -exec wc -l {} + | sort -n
@Sovietaced
Copy link

thanks!

@jvidalba1
Copy link

you can run this command: rake stats

@kevinhq
Copy link

kevinhq commented Jun 29, 2016

Great work! You can combine it with grep.

@jvidalba1: This one is counting each file. Different than rake stats.

@Parasgr7
Copy link

Thanks!

@Merovex
Copy link

Merovex commented Feb 2, 2021

Yeah, no. I have 2.3M cloc? This picks up a lot of extraneous junk. I'll stick with rake stats. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment