wc -- word, line, character, and byte count
The following options are available:
-c The number of bytes in each input file is written to the standard
output. This will cancel out any prior usage of the -m option.
-l The number of lines in each input file is written to the standard
output.
-m The number of characters in each input file is written to the
standard output. If the current locale does not support multi-
byte characters, this is equivalent to the -c option. This will
cancel out any prior usage of the -c option.
-w The number of words in each input file is written to the standard
output.
1、当前文件夹下的js文件数
find . -name ".js"|wc -l
2、当前文件夹下的js文件的代码行数
find . -name ".js"|xargs cat|wc -l
3、当前文件夹下的js文件去除空行之后的代码行数
grep -v ^$去除空行
find . -name "*.js"|xargs cat|grep -v ^$|wc -l