ITPub博客

首页 > > > linux shell wc 命令

linux shell wc 命令

作者:longmanma 时间:2020-02-19 23:31:08 0 删除 编辑

1. 语法与选项

Short OptionLong OptionOption Description
-c–bytesprint the byte counts
-m–charsprint the character counts
-l–linesprint the newline counts
 –files0-from=Fread input from the files specified by NUL-terminated names in file F
-L–max-line-lengthprint the length of the longest line
-w–wordsprint the word counts

2. 实例

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

$wc file

结果:

X  Y  Z  file
#X 行数
#Y 单词数
#Z 字符数

 

单独打印行数

$ wc -l file

 

 

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/2730/viewspace-3153509/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: typedef struct
请登录后发表评论 登录
全部评论

注册时间:2019-12-18

  • 博文量
    492
  • 访问量
    11999