find . -path "*/node_modules" -prune -o -name '*.ts' -print | xargs wc -lRun from root of project. Use -path + -prune to avoid counting node_modules directory. -o is “or” and allows the second check of “files ending with .ts”. -print to output the results. Pipe into xargs so that you can convert it to cli args for wc. Use -l with wc to count lines instead of words.