Linux Get Word Count of Files


Find Word Count of Linux Files

Using SSH, you can find the word count of one or more files.

Word Count of A Particular File

 # find . -name 'edit.php' | xargs wc -w   99 ./mobilesite/forms/system/scaffolding/views/edit.php  383 ./blogger/edit.php  164 ./edit.php  646 total 

Word Count of All PHP Files

 # find . -name '*.php' | xargs wc -w  or # find . '*.php' | xargs wc -w 

Total Word Count of All Files

 find . -type f -print0 | xargs -0 cat | wc -w