In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces Linux how to count the number of lines of code, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.
Count the number of file lines (single file):
Wc-l file
For example:
Homer@ubuntu:~/workspace/Android/game$ wc-l LGameAndroid2DActivity.Java
906 LGameAndroid2DActivity.java
Count the number of all file lines in the directory (all directories):
Find. -name * .java | xargs wc-l
For example:
Homer@ubuntu:~/workspace/android$ find. -name * .java | xargs wc-l
817. / game/core/LHandler.java
140. / game/core/LFlicker.java
...
515. / game/utils/collection/ArrayMap.java
162. / game/utils/CollisionUtils.java
178. / game/utils/NumberUtils.java
68753 total
Count the directories and sort by the number of rows (sorted by row size):
Find. -name * .java | xargs wc-l | sort-n
Homer@ubuntu:~/workspace/android$ find. -name * .java | xargs wc-l | sort-n
25. / game/action/sprite/Collidable.java
26. / game/core/graphics/component/CollisionQuery.java
27. / game/core/graphics/filter/ImageFilter.java
28. / game/LMode.java
...
1467. / game/core/geom/Path3D.java
1919. / game/core/graphics/Screen.java
2417. / game/core/graphics/device/LGraphics.java
3050. / game/core/geom/AffineTransform.java
68753 total
Count directories and sort by number of lines (sorted by line file name):
Find. -name * .java | xargs wc-l | sort-K2
Homer@ubuntu:~/workspace/android$ find. -name * .java | xargs wc-l | sort-K2
210. / game/action/ActionControl.java
116. / game/action/ActionEvent.java
34. / game/action/ActionListener.java
....
178. / game/utils/NumberUtils.java
342. / game/utils/RecordStoreUtils.java
58. / game/utils/ScreenUtils.java
650. / game/utils/StringUtils.java
68753 total
Thank you for reading this article carefully. I hope the article "how to count lines of code in Linux" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.