F~u~c~k i~t!
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
 
 

Display results as :
 


Rechercher Advanced Search

Top posting users this month
No user

GeoMap

How to calculate the number of lines of all files under a directory?

Go down

How to calculate the number of lines of all files under a directory? Empty How to calculate the number of lines of all files under a directory?

Post  halala Thu Jan 15, 2015 12:19 pm

For exmaple, you can use to calculate all the javascript , C, C++, HTML,and java codes under a directory.
Code:
find -name "*.js" -o -name "*.c" -o -name "*.class" -o -name "*.html" -o -name "*.cpp" -o -name "*.h" |xargs cat | wc -l

It utilized the expression feature of the 'find' command,
! for NOT
-o for OR
and you can use "\(" and "\)" as well.
halala
halala

帖子数 : 99
金币(Coin) : 4515
注册日期 : 2012-08-17

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum