Skip to content

Instantly share code, notes, and snippets.

@ozh
Created September 7, 2021 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ozh/0e729a856bd53ce71235afe92524e7f5 to your computer and use it in GitHub Desktop.
Save ozh/0e729a856bd53ce71235afe92524e7f5 to your computer and use it in GitHub Desktop.
Count LOC in a directory

In directory :

$ wc -l `find . -type f -name '*php'`

Result :

    53 ./admin/admin-ajax.php
   324 ./admin/index.php
    84 ./admin/install.php
   165 ./admin/plugins.php
(...)
    69 ./yourls-loader.php
 24862 total

Excluding directories :

$ wc -l `find . -type f -name '*php' | grep -v "includes/vendor"`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment