Skip to content

Instantly share code, notes, and snippets.

@ArthurDelannoyazerty
Created July 31, 2025 09:48
Show Gist options
  • Save ArthurDelannoyazerty/1ec25a48471ba1c6777ab2f012b43480 to your computer and use it in GitHub Desktop.
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)
# 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