count number of lines in a 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: count lines in files
find . -name '*.php' | xargs wc -l
# Basic syntax:
count = len(open('/path/to/the/file.ext').readlines())
find . -name '*.php' | xargs wc -l