上一篇讲的都是统计单个文件的方法,直接在命令行执行就可以。现在试试脚本的方式,统计多个文件的行数

一、统计目录下所有文件的文件数及所有行数

脚本暂时命名为count.sh,代码如下:

#!/bin/bash
# 计算当前或者指定目录的文件数目及所有文件的行数
fileCount=0
linesCount=0 function funCount(){
for file in `ls $1`
do
if [ -d $1"/"$file ];then
funCount $1"/"$file
else
#declare -i 定义整型变量fileLines
declare -i fileLines
#使用的是上一篇中的一种方法,可以灵活使用其他任何一种(grep awk wc -l等)
fileLines=`sed -n "$=" $1"/"$file`
#let是整数运算,linux中整数运算一般通过 let 和 expr 这两个指令来实现
#如对变量 x 加 1 可以写作:let "x = $x + 1" 或者 x=`expr $x + 1`
#个人感觉,二者差不多,前者表达比较简单,择优用之,具体可以在看专门的对比帖子
let linesCount=$linesCount+$fileLines
let filesCount=$filesCount+1
fi
done
} if [ $# -gt 0 ];then
for m_dir in $@
do
funCount $m_dir
done
else
funCount "."
fi
echo "filesCount = $filesCount"
echo "linesCount = $linesCount"

1,统计当前目录的文件数及所有行数

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAN8AAAAxCAIAAADV1euJAAAEyElEQVR4nO2cPZKzMAyGdYtcYSdtJsWeYIv0qRiqr8ktKMJBMjTcIXUKDkLFJb4CjCVbBhMC+Xuf2WIxNlbiN5IFSog4adk0TdM0ZUrLsT9XC8/wyiRFXdd1fct2z7YEhDAfgy+WKQAAAADAN7NKVvTdPDor2mW3982wphmflk113j/Wgl+i36iO+3M1Z3Jl+P5cmeSrP8Xaxj+DW7pcaHu3SaHhj1TUC6jzfhNeU52qRB6tzrS0x/tz1ZQp0f5cmQn352r0xa6nTtOUFBMX+tvVeST6JfpH9I/oSEREG3lIgcYf09L/EZGURVo2TZmyG0yOZK2MNefHr6IOt2jST8sh95lf6cr+8kPXvj2Zxl55W7qYbpfTyHAidVE6VSZFXSRBk2iX3eoOc4FddrtlWVHH7RfsBew0fVs/mtuXFF27OlG3T+lZ1PiQOo9eyw8REf0xv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pzoBLU1b9rSvouPEZfOfTmaPOj66gcy4OdT6DmAq6gD4+rYLO/kqb8sUNqPM5yLo4LRkO6uPTKuj0RxTyLcFDCgAAAAAAAN6e/x5gJQrvHTZ1AAAAAElFTkSuQmCC" alt="" />

2,统计指定文件目录的文件数及所有行数

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAXoAAAAyCAIAAADdvodyAAAG00lEQVR4nO2dPZLqOhCFexezhSlSiuCu4AbkE7mIbsIuHMBCKCfsYWIHLMSRF/FegH+6pSNZRoYB5nw1wSDUVvvvuFuShQghhBBCCCGEEEIIIYQQotid27Zt2/a8+2lP3paiapqmaepyvcz21mW92LYeTqbzT7Hv67JuqkJ9+nmXXoXdub0cNstu84/In6SKm8Mlp3Fgvjlc2o7hK1U2LaorOZ1kdbNLIfMlr8knuL5vd+E2y+EGv/e+WyVJNXk2l36EJD8fJTfwnl9abnbn8fPmcGnPO5HN4dI3uDlcJnf2cXLTFxXVzKv198lNUfWx4Z33fWwonSd06SdI8xPKzZfIH5F/Iv9EvkRE5MN+lEDhZ18y/ImIvc9357Y974YkztOgUZdQeKK3As1HkJbtzrEA5/gt3+rvuO3KV/u+cJCSlZz6aqf9hLkIvCY7mSmq6DNhXdZNR7+BdVnXZVk1aSnauAET/zvW2r/hwoENdanhwF2dHxzqWwmZO3u0Luu6rpumaaqqClX1m+8bCpsPxiiZWpc1Ok6wbVUKa4J9txvoStNPnLKuKlPTNYcuTZy4icu4JyQ3X17Jp4iI/FWRCywUL7rp4wz/o68Iyh0VnmgxOo8G0eCok7XpnbX44cl2VJnVXr6PIiL7kxGj/SpsfsXIjXvHhm88E6Cuy6q/RPqrbTKA1c+cohzviqsRjhr0VRtoKOmJnu08aAube3vUFazLuqnLtXMjKeVzb+XaHCFgDgw7s75y5DDAAxI6YP6+w7M548SZoxSXm4DzwROXHOGF5OZTffwY4xT5FPkbLrziyE0fUnRByuUSlBsrTN234RQIyc0QCflRDBIgD08vtLIM3+5PY1ATN+/wzse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u62DMLNmDXKYVpICMnBvWVjQz79d2ACoFEWFEWAEas7LYOQeTDuONhFCCGEEEIIIYQQQgghhBDyS4kuK8EXFAkhi/OoZUtffwEKzjMmJJOHyM3LLECBf6Dk+l1dVXxHnJAcPLkBLynCJSBM3bdYgMJRGD3JuKiaquCSFITkgaMb73VvtATEuy1A4cmN+klE9GOKhJB5pMoN+s3gd1uAwkmmulhqaIVyQ0geiXITCDrAbfzSC1Bo50v3d7wpN4TkkSM3b70ARbdxt5OoaeoyxZwQ4pGyAEXghn+3BShEilI1hFbgYHRDSBZ2WQk05BO84d9tAYrJuY+UG0IIIYQQQgghhBBCCCEP5j/0R8jr8D+QtjIJX4Dz6wAAAABJRU5ErkJggg==" alt="" />

二、统计目录下所有文件的文件数及所有行数,并指出文件路径和文件类型

脚本暂时命名为helloworldCount.sh,代码如下:

#!/bin/bash

extens=(".c" ".cpp" ".h" ".class" ".hpp" ) #这个array为空其实一样

filesCount=0
linesCount=0
function funCount(){
for file in `ls $1`
do
if [ -d $1"/"$file ];then
funCount $1"/"$file
else
fileName=$1"/"$file EXTENSION="."${fileName##*.}
#echo "------"$EXTENSION
# ${fileName##*.} 截取.之后的部分
echo "fileName = $fileName Extension = $EXTENSION" #if [[ "${extens[@]}/$EXTENSION/}" != "${extens[@]}" ]];then
#echo "--------"${extens[@]}/$EXTENSION/
#echo "--------"${extens[@]}
#/ 用来拼接多个变量并组成一个array
if [[ "${extens[@]}/$EXTENSION/}" != "${extens[@]}" ]];then
declare -i fileLines
fileLines=`sed -n "$=" $fileName`
echo $fileName":"$fileLines
let linesCount=$linesCount+$fileLines
let filesCount=$filesCount+1
fi
fi
done
} if [ $# -gt 0 ];then
for m_dir in $@
do
funCount $m_dir
done
else
funCount "."
fi echo "filesCount = $filesCount"
echo "linesCount = $linesCount"

1,统计当前目录的文件数及所有行数

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVEAAACKCAIAAACcmu5NAAAO7ElEQVR4nO2dO3KlOhCGtY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HLCxKrrhRWVyzQud1xfPyAejfvRYDwa7yHVxPxXRd9eUtPRjxLyvthRA49o5pmW7whFkTxQzMuOhMe+JDrcK8UPZuKBYinQQ9wTrEzt+S+5yFzXJeRNAVNnb0SbIhM56CNHmAUxJvBQtZjs6L1PJZI5rYoHilnFy3eHtEKc5FqMKwNqW2jeLGkiebHqSwV9JujJvNqn+jL3GeshjpaiflS0lMEoIW9E4VHTk1YU52iR9lrci63pEkIIIa8ADxQjhBBCtjAuENKLEkIIIYQQQgghhBBCjgStRYr3/6MfqRNCCCHvR/jV0m0vz2SfFuzmjfd/cfUIKQkhhLwyhQ1iFBv8qPw6ff7yfyN7+9F8Y5q4XgghhLwpate3bFce+EE58KNgxRdFdLU9D8rf41/QoVrOJ/47wq80CSGEBMBxF0o1flTtuz7sPQTPpQIeKbw/XLanjN367TBXJ3bzJYQQQhxW+1G4CS7cXhQuCMf3K/c3HI/4Ub3VeiV2daNxQgghBLHJjyL/ZNd6PT/qLOGGEk0ZeyP2tCeEEEIctvjRsp8RJ52g88ji8egGP7owHpXyMyglhBBSIe5HTRo4fss5ggq9r4uejy44pMyXfTXiHEkegEUIISSC9kWlF2HVuVTwvCnvCCrwHq99X3fRIWVC2n3cqQheGYwSQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEkA0UT0PjLu2EEEJIhG2nocV5/nPTuMMRIYQQy1386NOcmya+g1VfqvZdxxNgCCGEKIwfBTu1w5PLxLUvcW6acp359kZNd+0anqRGCCHEgONRc5gLOrns1c5NM350rOvS9kPj6EcJIYRIon7UOM8XPDdNresO0e9UC/0oIYQQQ9CPOmEi8E9PfW5aLnx78+4iLKUfJYQQItniR1/63LShcP0g9nrt20h2Qggh70Hk3DTHk73auWkpNW1WETo4jvEoIYQQjTwNDb0I63qyVzs3rbo5Bf0oIYQQQgghhBBCCCGEEEIIIYQQQgh5I/4PtSOH97DzyOsAAAAASUVORK5CYII=" alt="" />

脚本中涉及到的知识点罗列如下:

1,declare -i 定义整型变量fileLines
2,let是整数运算,linux中整数运算一般通过 let 和 expr 这两个指令来实现,如对变量 x 加 1 可以写作:let "x = $x + 1" 或者 x=`expr $x + 1`,个人感觉,二者差不多,前者表达比较简单,择优用之,具体可以在看专门的对比帖子
3,${fileName##*.} 截取.之后的部分
4,/ 用来拼接多个变量并组成一个array

参考来源:http://www.jb51.net/article/61943.htm

linux下统计文本行数的各种方法(二)的更多相关文章

  1. linux下统计文本行数的各种方法

    方法一:awk  awk '{print NR}' test1.txt | tail -n1

  2. linux下统计文本行数的各种方法(一)

    文件test1.txt有17行 方法一: awk '{print NR}' test1.txt | tail -n1

  3. Linux下统计代码行数

    使用wc统计代码行数 最近写了一些代码,想统计一下代码的行数,在eclipse中好像没这功能,网上搜了一下才发现原来Linux有一个统计文件行数的命令wc.使用wc可以打印出每个文件和总文件的行数.字 ...

  4. linux 设置查看文本行数

    在一般模式下,即摁下esc按键下的模式: 设置行数为:set nu(此处的冒号需要带上) 取消行号为:set nonu(此处的冒号需要带上)

  5. C# VII: 统计文本行数

    本文基于StackOverflow的以下问题收集整理而成. What is the fastest waty to count newlines in a large .NET string: htt ...

  6. linux wc 的用法-linux 下统计行数、单词数、字符个数

    linux wc 的用法-linux 下统计行数.单词数.字符个数   wc : wc -l 统计有多少行 wc -w 统计有多少个单词 wc -c 统计有多少个字符

  7. Linux - wc统计文件行数、单词数或字节数

    一 wc简单介绍 wc命令用来打印文件的文本行数.单词数.字节数等(print the number of newlines, words, and bytes in files).在Windows的 ...

  8. 【转】【Linux】Linux下统计当前文件夹下的文件个数、目录个数

    [转][Linux]Linux下统计当前文件夹下的文件个数.目录个数 统计当前文件夹下文件的个数,包括子文件夹里的 ls -lR|grep "^-"|wc -l 统计文件夹下目录的 ...

  9. Linux下统计出现次数最多的指定字段值

    假设桌面上有一个叫“data.txt”的文本,内容如下: {id='xxx' info='xxx' kk='xxx' target='111111' dd='xxx'}{id='xxx' info=' ...

随机推荐

  1. SQL server T-sql语句查询执行顺序

    前言 数据库的查询执行,毋庸置疑是程序员必备的技能之一,然而数据库查询执行的过程绚烂多彩,却是很少被人了解,今天我们来深入了解下sql查询的来龙去脉,为查询的性能优化打个基础 这篇博客,摒弃查询优化性 ...

  2. Win7 WPF程序无法接受外部拖拽

    最近在WPF项目中遇到一个问题.虽然选择了AllowDrop = True,但是还是无法支持从外部拖拽文件到程序,倒是内部拖拽(如从一个列表拖拽到树)和从程序拖拽到外部可以. 解决过程 1.考虑是程序 ...

  3. C#中的Linq使用

    First()与FirstOrDefault() 如何结合Expression 如何拼接以避免复杂的switch语句

  4. 可变大小、颜色边框、样式的UISwitch

    1.CHSwitch.h // // 文 件 名:CHSwitch.h // // 版权所有:Copyright © 2018 lelight. All rights reserved. // 创 建 ...

  5. Mybatis 的动态 SQL 语句

    <if>标签 我们根据实体类的不同取值,使用不同的 SQL 语句来进行查询. 比如在 id 如果不为空时可以根据 id 查询, 如果 username 不同空时还要加入用户名作为条件.这种 ...

  6. MongoDB 深入学习 -- ReplSet,Sharding,Security,Aggregation,Command

    萌新最近在对付MongoDB,因此每天都在翻官方文档,这里随便做点笔记 ReplSet 与 Sharding ReplSet 是副本集,也就是主从集合.可以用来做负载均衡,数据热备份.副本集的配置相对 ...

  7. vs更改项目文件夹名称

    改完之后会提示找不到.csproj,用文档工具打开.sln文件,把里面找.csproj的路径修改一下就好了

  8. Django 实现上传图片功能

    很多时候我们要用到图片上传功能,如果图片一直用放在别的网站上,通过加载网址的方式来显示的话其实也挺麻烦的,我们通过使用 django-filer 这个模块实现将图片文件直接放在自己的网站上. 感兴趣的 ...

  9. ant实例

    <?xml version="1.0" encoding="UTF-8" ?> <project name="javaTest&qu ...

  10. CF138D World of Darkraft

    $ \color{#0066ff}{ 题目描述 }$ n*m的格子,每个格子有字符'L','R',X',初始可以选择所有格子. 当选了 'L'的格子时,当前格子左下右上这条线上所有点不能选; 当选了 ...