Skip to content

Instantly share code, notes, and snippets.

@suewonjp
Last active March 10, 2018 00:31
Show Gist options
  • Save suewonjp/3e3cc8b8c2ae353e30189d182b618aa9 to your computer and use it in GitHub Desktop.
Save suewonjp/3e3cc8b8c2ae353e30189d182b618aa9 to your computer and use it in GitHub Desktop.
Count the number of source code lines using lf.sh
### Count lines in every Python source file in the current project
count=0
for f in `lf . .py`; do count=$(( $count + `cat $f | wc -l` )); done
echo $count
@suewonjp
Copy link
Author

Notice that this code uses https://github.com/suewonjp/lf.sh

( lf.sh is a Bash utility to help you quickly search arbitrary files or search text from files. )

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