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

linux shell wc 命令的更多相关文章

  1. Linux shell tr 命令详解

    该随笔摘自 https://www.jb51.net/article/103892.htm Linux shell tr 命令详解 1. 用途 tr,translate的简写,主要用于压缩重复字符,删 ...

  2. linux中wc命令

    目录 一:linux中wc命令 1.wc命令介绍 2.wc命令作用 3.wc命令格式 4.参数 5.解析案例 一:linux中wc命令 1.wc命令介绍 Linux wc命令用于计算字数. 利用wc指 ...

  3. linux shell 管道命令(pipe)使用及与shell重定向区别

    管道命令操作符是:”|”,它仅能处理经由前面一个指令传出的正确输出信息,也就是 standard output 的信息,对于 stdandarderror 信息没有直接处理能力.然后,传递给下一个命令 ...

  4. linux之wc命令详解

    Linux系统中wc(Word Count)命令的功能为统计指定文件中的字节数.字数.行数,并将统计结果显示输出. 1.命令格式 wc [options] 文件... 2.命令功能 统计指定文件中的字 ...

  5. python文件读写操作与linux shell变量命令交互执行

    python对文件的读写还是挺方便的,与linux shell的交互变量需要转换一下才能用,这比较头疼! #coding=utf-8 #!/usr/bin/python import os impor ...

  6. Linux shell日常命令和技巧

    转自:http://www.vaikan.com/linux-shell-tips-and-tricks/ 原文:http://www.techbar.me/linux-shell-tips/ 使用L ...

  7. Linux Shell : Test命令参数解析

    格式: test conditions test -n string : string 不为空 test -z string : string 为空 test int1 -eq int2  : int ...

  8. Linux shell 及命令汇总

    1 文件管理命令 1.cat命令:将文件内容连接后传送到标准输出或重定向到文件 2.chmod命令:更改文件的访问权限 3.chown命令:更改文件的所有者 4.find命令:查找(符合条件)文件并将 ...

  9. Linux Shell nohup命令用法

    linux的nohup命令的用法.   在应用Unix/Linux时,我们一般想让某个程序在后台运行,于是我们将常会用 & 在程序结尾来让程序自动运行.比如我们要运行mysql在后台: /us ...

随机推荐

  1. bzoj 4066: 简单题 kd-tree

    4066: 简单题 Time Limit: 50 Sec  Memory Limit: 20 MBSubmit: 234  Solved: 82[Submit][Status][Discuss] De ...

  2. 【POJ 1984】Navigation Nightmare(带权并查集)

    Navigation Nightmare Description Farmer John's pastoral neighborhood has N farms (2 <= N <= 40 ...

  3. Jrtplib

    RTP/RTCP 视频数据传输 (续) http://blog.csdn.net/neohuo/article/details/821442

  4. ANDROID_MARS学习笔记_S05_006_距离传感器

    import android.app.Activity; import android.content.Context; import android.hardware.Sensor; import ...

  5. C#面向对象基础类与方法

    C#是纯粹的面向对象编程语言,它真正体现了“一切皆为对象”的精神. 在C#中,即使是最基本的数据类型,如int,double,bool类型,都属于System.Object(Object为所有类型的基 ...

  6. perl 监控数据库用到的数据结构

    [root@yun1 test]# cat a1.pl my $h={'192.168.11.187'=>['root','1234567'], '192.168.5.7' =>['roo ...

  7. [LeetCode#218] The Skyline Problem

    Problem: A city's skyline is the outer contour of the silhouette formed by all the buildings in that ...

  8. linux系统目录详解

    Linux目录结构包括文件类型和一些重要的文件子目录. linux文件系统的最顶端是/,称为linux的root,所有的目录.文件.设备都在/之下.文件类型linux有四种基本文件系统类型:普通文件. ...

  9. FFT小结

    先上模板 #include<cstdio> #include<cmath> <<)*+; typedef long long ll; ll power(ll t,; ...

  10. Robot Framework+appium集成安装

    appium(中文教程,源码)是一款开源跨平台测试自动化工具,用于测试原生.移动web和混合应用,支持 iOS, Android和FirefoxOS平台. appium集成以下框架驱动自动化测试: i ...