Created
July 31, 2025 09:48
-
-
Save ArthurDelannoyazerty/1ec25a48471ba1c6777ab2f012b43480 to your computer and use it in GitHub Desktop.
Count the number of line in a project (pure bash) (excluding files/folders)
This file contains hidden or 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
# For all files in project root folder with some filters | |
find . \ | |
-name '*' \ | |
-not -path "./.venv/*" \ | |
-not -path "./docker/DBvolumes/*" \ | |
-not -path "./logs/*" \ | |
-not -path "./.git/*" \ | |
-not -path "*__pycache__*" \ | |
-not -path "./uv.lock" \ | |
| xargs wc -l \ | |
| sort -n | |
# For python files in "src/" folder | |
find src/ \ | |
-name '*.py' \ | |
-not -path "./.venv/*" \ | |
-not -path "./docker/DBvolumes/*" \ | |
-not -path "./logs/*" \ | |
-not -path "./.git/*" \ | |
-not -path "*__pycache__*" \ | |
-not -path "./uv.lock" \ | |
| xargs wc -l \ | |
| sort -n |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment