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. 實例
打印文件的行數,單詞數,字符串數
$wc file
結果:
X Y Z file
#X 行數
#Y 單詞數
#Z 字符數
單獨打印行數
$ wc -l file