#输出排序后文件名
file='find . -name "*.[ch]" | sort'
#统计文件个数
filecnt='find . -name "*.[ch]" | wc -l'
#simple,统计所有行数
simple='find . -name "*.[ch]" | xargs cat|wc -l'
#emptylines,统计除了空行 exclude the empty lines
emptylines='find . -name "*.[ch]" |xargs cat|grep -v ^$|wc -l'
#annotations,统计除了空行和单行注释
annotations='find . -name "*.[ch]" |xargs cat|grep -v -e ^$ -e ^\s*\/\/.*$|wc -l' echo ${file} && eval ${file}
echo ${filecnt} && eval ${filecnt}
echo ${simple} && eval ${simple}
echo ${emptylines} && eval ${emptylines}
echo ${annotations} && eval ${annotations} auss@ubuntu:~/Projects/Qt/LeetCode/leetcode2017$ bash ./run_statistic.sh
find . -name "*.[ch]" | sort
./ch00_dirty.h
./ch01_array.h
./ch02_list.h
./ch03_string.h
./ch04_stack_queue.h
./ch05_tree.h
./ch06_sort.h
./ch07_search.h
./ch08_brute.h
./ch09_bfs.h
./ch10_dfs.h
./ch11_divide_and_conquer.h
./ch12_gready.h
./ch13_dynamic_programming.h
./ch14_graph.h
./ch15_detail.h
./utilities.h
find . -name "*.[ch]" | wc -l
17
find . -name "*.[ch]" | xargs cat|wc -l
10456
find . -name "*.[ch]" |xargs cat|grep -v ^$|wc -l
9488
find . -name "*.[ch]" |xargs cat|grep -v -e ^$ -e ^\s*\/\/.*$|wc -l
9165

[2017.02.13] linux平台下统计C++项目文件个数和代码行数的更多相关文章

  1. 【原】Mac下统计任意文件夹中代码行数的工

    [链接][原]Mac下统计任意文件夹中代码行数的工http://www.cnblogs.com/wengzilin/p/4580646.html

  2. 【原】Mac下统计任意文件夹中代码行数的工具——cloc

    这里介绍一个Mac系统统计代码行数的工具cloc. 1.首先,安装homebrew,已安装的请跳过. 打开终端工具Terminal,输入下列命令.过程中会让你按RETURN键以及输入mac桌面密码,按 ...

  3. iOS 统计Xcode整个工程的代码行数

    小技巧5-iOS 统计Xcode整个工程的代码行数 1.打开终端 2.cd 空格 将工程的文件夹拖到终端上,回车,此时进入到工程的路径 此时已经进入到工程文件夹下 3.运行指令 a. find . - ...

  4. 使用Eclipse可以方便的统计工程或文件的代码行数,

    使用Eclipse可以方便的统计工程或文件的代码行数,方法如下: 1.点击要统计的项目或许文件夹,在菜单栏点击Search,然后点击File... 2.选中正则表达式(Regular expressi ...

  5. Linux统计目录下文件个数及代码行数

    1. 统计当前目录下,php文件数量 find ./ -name "*.php" | wc -l 2. 统计当前目录下所有php文件代码行数 find ./ -name " ...

  6. 统计Visual Studio项目的代码行数

    原文转自 https://blog.csdn.net/tyc129/article/details/74279806 使用Visual Studio 自带的在文件中查找功能中的正则表达式实现代码统计功 ...

  7. Linux统计文件个数或是代码行数

    统计指定后缀名的文件总个数命令: find . -name *.cpp | wc -l 统计一个目录下代码总行数以及单个文件行数: find . -name *.h | xargs wc -l lin ...

  8. 统计iOS项目的总代码行数的方法

    打开终端, 用cd命令 定位到工程所在的目录,然后调用以下命名即可把每个源代码文件行数及总数统计出来: find . "(" -name "*.m" -or - ...

  9. linux下查看目录下某种文件类型累计的代码行数

    find 路径 -name '*.py' | xargs wc -l

随机推荐

  1. ssh基础(1)

    1.链接远程 命令:ssh root@1.1.1.1 2.执行远程脚本 命令:ssh root@1.1.1.1  /data/demo/test.sh > 111.txt   (执行远程的tes ...

  2. C-order/Fortran-order(Row-/Column-major order)

    1. row-major / column-major order 无论是行序优先还是列序优先,其实在计算机计算中,指的都是在线性空间(linear storage,如 RAM,也即连续内存存储 co ...

  3. dwc_otg驱动 "BUG: sleeping function called from invalid context at mm/page_alloc.c"

    方案商的开发板上otg功能只能做device,硬件看过后说没有5v供电,加上后能够识别U盘了,但是内核报了错 [ 3.264000] usb 2-1: new high-speed USB devic ...

  4. MyEclipse参加ibatis DTD文件实现xml自己主动提示功能

    当我们写ibatis当配置文件,希xml自己主动提示. 这就要求我们的加盟DTD档 SqlMapConfig.xml中开头部分有这么一句话 <!DOCTYPE sqlMapConfig PUBL ...

  5. 学习Hadoop和Spark的好的资源

    1. 官网http://spark.apache.org 有各种资源链接: 2. 总结得很好的个人博客[从零开始学Hadoop系列]1)初识http://blog.csdn.net/u01016816 ...

  6. 解决用户绕过Servlet直接访问jsp页面

    解决用户绕过ActionServlet,直接访问jsp文件的问题 1.将所有jsp文件拷贝到WEB-INF目录下 因为WEB-INF目录中的内容不能直接访问,但能转发过来 项目结构图如下: 2.修改s ...

  7. Cache memory power reduction techniques

    Methods and apparatus to provide for power consumption reduction in memories (such as cache memories ...

  8. Leetcode 328 Contains Duplicate set和map应用

    找出数组中重复的数,裸的map和set题 class Solution { public: bool containsDuplicate(vector<int>& nums) { ...

  9. 利用WPF的ListView进行大数据量异步加载

    原文:利用WPF的ListView进行大数据量异步加载 由于之前利用Winform的ListView进行大数据量加载的时候,诟病良多,所以今天试着用WPF的ListView来做了一下,结果没有让我失望 ...

  10. OpenGL(六) gluLookAt和gluPerspective函数解析

    在调用gluLookAt和gluPerspective函数之前一般要先调用一下glLoadIdentity函数,先说一下这个函数是做什么的. glLoadIdentity glLoadIdentity ...