Skip to content

Instantly share code, notes, and snippets.

@gerritjvv
Created January 24, 2025 10:26
Show Gist options
  • Save gerritjvv/b5f7c65aaf828417ba9ff652d196f565 to your computer and use it in GitHub Desktop.
Save gerritjvv/b5f7c65aaf828417ba9ff652d196f565 to your computer and use it in GitHub Desktop.
linecount.sh
#!/usr/bin/env bash
#
# Example usage:
# ./linecount.sh . java
# > 4000 total
#
DIR="$1"
EXT="$2"
find ${DIR} -iname "*.$EXT" -exec wc -l {} + | tail -n1
@gerritjvv
Copy link
Author

Count lines in files with a specific extension

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment