Skip to content

Instantly share code, notes, and snippets.

@baerla
Created January 14, 2021 12:39
Show Gist options
  • Save baerla/2a408f09446f9dab9d1df2f2f203ddde to your computer and use it in GitHub Desktop.
Save baerla/2a408f09446f9dab9d1df2f2f203ddde to your computer and use it in GitHub Desktop.
Get line count in directory for given file extension
#!/bin/bash
# usage: ./getLineCount.sh *.cs
find . -name "$1" -exec wc -l {} \; | mawk '{s+=$1} END {print s}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment