Created
September 25, 2021 09:37
-
-
Save 0x48piraj/f45f8125e55ff2a389a9e6fa3311ad3f to your computer and use it in GitHub Desktop.
CLOC: Count the lines of code of any project recursively grouped by file extensions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find ./ -not -path "./.git/*" -type f -exec wc -l {} + | | |
awk '{print tolower($0)}' | | |
sed -e '$ d' | | |
sed -e "s#/.*/##g" | | |
sed -e "s/\./ \./g" | | |
awk ' | |
{ if ( NF <= 2 ) { count["none"] += $1 } else { count[$NF] += $1 } } | |
{ next } | |
END { for (group in count) printf("%d%s%s\n", count[group], OFS, group) } | |
' | | |
sort -n |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment