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. Cocos2d-x 3.0 beta 中加入附加项目,解决无法打开包括文件:“extensions/ExtensionMacros.h”: No such file or directory”

    Cocos2d-x 3.0 Alpha 1开始 对目录结构进行了整合.结果有些附加项目也被在项目中被精简出去. 比如说如果你需要使用CocoStdio导出的JSON.或使用Extensions扩展库, ...

  2. How to new a screen in linux

    screen -R -D: create a screen Ctrl + A & Ctrl + D: leave a screen

  3. matlab学习笔记(一)单元数组

    matlab学习笔记(一)单元数组 1.floor(x) :取最小的整数 floor(3.18)=3,floor(3.98)=3 ceil(x)  :取最大的整数 ceil(3.18)=4,ceil( ...

  4. Spring 配置方式

    1.bean的配置方式:通过全类名(反射),通过工厂方法(静态工厂方法&实例工厂方法).FactoryBean. 2.静态工厂方法:直接调用某一个类的静态方法就可以返回bean的实例. cla ...

  5. Android sqlite 数据库在java代码中的增删改查

    private void queryPerson(PersonSQLiteOpenHelper personSQLiteOpenHelper) { SQLiteDatabase sqLiteDatab ...

  6. Android 写文件到手机

    1)// 在手机中创建文件 FileOutputStream phone_outStream =this.openFileOutput("1.txt", Context.MODE_ ...

  7. MySQL源码之两阶段提交

    在双1的情况下,两阶段提交的过程 环境准备:mysql 5.5.18, innodb 1.1 version配置: sync_binlog=1 innodb_flush_log_at_trx_comm ...

  8. ☀【单位】REM

    CSS3的REM设置字体大小 支持的浏览器还是蛮多的,比如:Mozilla Firefox 3.6+.Apple Safari 5+.Google Chrome.IE9+和Opera11+.只是可怜的 ...

  9. JS实现表单输入Enter键转换焦点框

    <form> <input type="text" onkeypress="return handleEnter(this, event)"& ...

  10. JavaScript---网络编程(6)-Dom和Bom模型概念讲解(节点获取,window对象)

    本节讲Dom和Bom模型概念讲解(节点获取,window对象). out.js: 写了2个输出到页面的函数. function println(param){ document.write(param ...