count lines in file code example
Example 1: python how to count the lines in a file
# Basic syntax:
count = len(open('/path/to/the/file.ext').readlines())
Example 2: shell count number of lines
$ wc -l < /dir/file.txt
3272485
Example 3: count lines in files
find . -name '*.php' | xargs wc -l