4.1.2.5 linux文件管理 :文件属性操作 :文件内容 :统计

4.1.2.5 linux文件管理 :文件属性操作 :文件内容 :统计字

1. wc命令
1.1 wc命令 - 普通 (wc [file...])
打印行数,单词数,字节数

$ wc 39frpc.log  target.txt
 0  0  0 39frpc.log
 9  9 52 target.txt
 9  9 52 总用量

1.2 wc命令 - 打印字节数 (wc -c [file...])

$ wc -c  39frpc.log  target.txt
 0 39frpc.log
52 target.txt
52 总用量

1.2 wc命令 - 打印字符数 (wc -m [file...])

$ wc -c  39frpc.log  target.txt
 0 39frpc.log
52 target.txt
52 总用量

1.3 wc命令 - 打印行数 (wc -l [file...])

$ wc -l  39frpc.log  target.txt
 0 39frpc.log
 9 target.txt
 9 总用量

1.4 wc命令 - 打印单词数量 (wc -w [file...])

$ wc -w  39frpc.log  target.txt
 0 39frpc.log
10 target.txt
10 总用量

1.4 wc命令 - 打印最长行的长度 (wc -L [file...])

$ wc -L  39frpc.log  target.txt
 0 39frpc.log
11 target.txt
11 总用量

wc 命令详解

  -c, --bytes            print the byte counts ##打印字节数
  -m, --chars            print the character counts ##打印字符数
  -l, --lines            print the newline counts ##打印行数
      --files0-from=文件  ##从指定文件读取以NUL 终止的名称,如果该文件被
                    指定为"-"则从标准输入读文件名
  -L, --max-line-length ##显示最长行的长度
  -w, --words           ##显示单词计数
      --help            ##显示此帮助信息并退出

▽
head
      --version     显示版本信息并退出

你可能感兴趣的:(4.1.2.5 linux文件管理 :文件属性操作 :文件内容 :统计)