find -type f -name "*.js"|grep -c .js
Taking apart the one-liner , find executes by defining we are looking for a regular file (-type f) and the name ends with js (-name "*.js"). Then we pipe it to grep to suppress the grep output and prints the number of lines coming from the pipe(-c) and matching the .js string.
No comments:
Post a Comment