linux shell wc 命令

时间:2014-06-16 00:46:11   收藏:0   阅读:509

1. 语法与选项

Short Option Long Option Option Description
-c –bytes print the byte counts
-m –chars print the character counts
-l –lines print the newline counts
  –files0-from=F read input from the files specified by NUL-terminated names in file F
-L –max-line-length print the length of the longest line
-w –words print the word counts

2. 实例

   打印文件的行数,单词数,字符串数

bubuko.com,布布扣
$wc file
bubuko.com,布布扣

结果:

bubuko.com,布布扣
X  Y  Z  file
#X 行数
#Y 单词数
#Z 字符数
bubuko.com,布布扣

 

单独打印行数

bubuko.com,布布扣
$ wc -l file
bubuko.com,布布扣

 

 

 

 

linux shell wc 命令,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!