count lines in files 1

count lines in files

find . -name '*.php' | xargs wc -l

Here is what the above code is Doing:
1. find . -name ‘*.php’
– find all files in the current directory (.) that end with .php
2. xargs wc -l
– pass the output of the previous command to the wc command
– wc -l counts the number of lines in the file

Similar Posts