wc 功能说明:wc命令用于统计文件的行数、单词数或字节数。 参数选项: -c 统计字节数。 -l 统计行数。 -m 统计字符数。 -w 统计单词数。 -L 打印最长行的长度。 省略选项等于参数 -lwc。 使用范例: [root@testdb ~]# cat /etc/inittab # inittab is no longer used when using systemd. # # ADDING CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM. # # Ctrl-Alt-Delete is handled by /usr/lib/systemd/system/ctrl-alt-del.target # # systemd uses 'targets' instead of runlevels. By default, there are two main targets: # # multi-user.target: analogous to runlevel 3 # graphical.target: analogous to runlevel 5 # # To view current default target, run: # systemctl get-default # # To set a default target, run: # systemctl set-default TARGET.target # [root@testdb ~]# wc /etc/inittab 17 80 511 /etc/inittab [root@testdb ~]# wc -c /etc/inittab 511 /etc/inittab [root@testdb ~]# wc -l /etc/inittab 17 /etc/inittab [root@testdb ~]# wc -m /etc/inittab 511 /etc/inittab [root@testdb ~]# wc -w /etc/inittab 80 /etc/inittab [root@testdb ~]# wc -L /etc/inittab 86 /etc/inittab