Count and sort lines across many files
count lines of code in project | find longest files linux | count lines in all php files | wc | find | linesfind /var/www/vhosts/example.com/httpdocs/wp-content/themes -type f -name '*.php' -exec wc -l {} + | sort -rn | head -n 20Finds all files with the given extension, counts their lines with wc -l and sorts in descending order. At the top is the sum as a total line (or insgesamt with a German locale), followed by the longest files. Useful for estimating the size of a theme or plugin, or for spotting unusually large individual files.
Note: With very many files, find calls wc several times, so several subtotals appear.
Also searched as
- count lines of code in project
- find longest files linux
- count lines in all php files