shell命令-wc

来源:互联网 发布:命令模式 安卓源码 编辑:程序博客网 时间:2024/05/17 09:20

用途

统计文件中的字符数、单词数、行数

语法

wc [OPTION]… [FILE]…
wc [OPTION]… –files0-from=F

描述

-c 统计字节数

-m 统计字符数

-l 统计行数

-w 统计单词数

-L 统计最长行的字符数

–files0-from=F
read input from the files specified by NUL-terminated names in file F; If F is - then read names from standard input

举例

apuser@bjzktmp05u:~/Mygithub/shellscripts$ cat head.txt asdfghjklzxcvbnm1234567899876543217418522963qwertgfdazxcva5sd4a65sd165w4dhjasasdsaasdakjsndaksjcnaksjcapuser@bjzktmp05u:~/Mygithub/shellscripts$ wc -l head.txt 8 head.txtapuser@bjzktmp05u:~/Mygithub/shellscripts$ wc -c head.txt 110 head.txtapuser@bjzktmp05u:~/Mygithub/shellscripts$ wc -m head.txt 110 head.txtapuser@bjzktmp05u:~/Mygithub/shellscripts$ wc -w head.txt 8 head.txtapuser@bjzktmp05u:~/Mygithub/shellscripts$ wc -L head.txt 17 head.txt统计的是这一行 akjsndaksjcnaksjc 共17个字符
0 0
原创粉丝点击