Skip to content

Instantly share code, notes, and snippets.

@ahaggart
Created August 24, 2018 00:52
Show Gist options
  • Save ahaggart/cdac19ef38116285b2d27a5dc8b851de to your computer and use it in GitHub Desktop.
Save ahaggart/cdac19ef38116285b2d27a5dc8b851de to your computer and use it in GitHub Desktop.
Get the line count of all files rooted at the current directory.
#!/bin/bash
if [ ! "$#" = "1" ]; then
echo "usage: wcr file_extension"
exit;
fi
find . -name "*.$1" | xargs wc -l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment