Count all the lines of given directories recursively In this example want to count the number of lines of every PHP file in two directories, dir-1 and dir-2/subdir: find {dir-1,dir-2/subdir} -name '*.php' | xargs wc -l The output is the sumarize of each line: 3212 total