1
wc file.txt
123
mrcan@ubuntu:~$ wc testif.sh 9 27 131 testif.sh 行 词 字符
默认显示行、词、字符数。
可以单独指定:
123456
mrcan@ubuntu:~$ wc -w testif.sh 27 testif.shmrcan@ubuntu:~$ wc -l testif.sh 9 testif.shmrcan@ubuntu:~$ wc -c testif.sh 131 testif.sh
-w
只要中间没有空格、换行符,就是1个word。
-l
-c
1个英文字母算1个字符