Linux wc指令解析
wc指令比较实用,可以统计文件中的字节数、字符数、行数、字数等。
先通过 wc --help 查看指令帮助。
$ wc --help
Usage: wc [OPTION]... [FILE]...
or: wc [OPTION]... --files0-from=F
Print newline, word, and byte counts for each FILE, and a total line if
more than one FILE is specified. With no FILE, or when FILE is -,
read standard input. A word is a non-zero-length sequence of characters
delimited by white space.
The options below may be used to select which counts are printed, always in
the following order: newline, word, character, byte, maximum line length.
-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;
If F is - then read names from standard input
-L, --max-line-length print the length of the longest line
-w, --words print the word counts
--help display this help and exit
--version output version information and exit Report wc bugs to bug-coreutils@gnu.org
GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
General help using GNU software: <http://www.gnu.org/gethelp/>
For complete documentation, run: info coreutils 'wc invocation'
格式:wc [option] ... [file]
$ cat .txt mn xyz
-c 或者 -bytes:打印文件字节数
$ wc -c .txt
.txt
-m 或者 --chars:打印文件字符数
$ wc -m .txt
.txt
-l 或者 --lines:打印文件行数
$ wc -l .txt
.txt
-L 或者 --max-line-length:打印最长一行的长度
$ wc -L .txt
.txt
-w 或者 --words:打印字数
$ wc -w .txt
.txt
--help:查看指令帮助并退出
--version:输出版本信息并退出
$ wc --version
wc (GNU coreutils) 8.21
Copyright (C) Free Software Foundation, Inc.
License GPLv3+: GNU GPL version or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Written by Paul Rubin and David MacKenzie.
Linux wc指令解析的更多相关文章
- Linux进阶指令(重点)
三.Linux进阶指令(重点) 1.df指令 作用:查看磁盘的空间 #df -h 选项:-h 表示以可读性较高的形式展示大小 2.free指令 作用:查看内存使用情况 #free ...
- Linux常用指令【转载】
[收藏]Linux常用指令[转载] $ 命令行提示符 粗体表示命令 斜体表示参数 filename, file1, file2 都是文件名.有时文件名有后缀,比如file.zip command 命令 ...
- 【ZZ】Linux常用指令
linux常用指令 - 个人文章 - SegmentFault 思否 https://segmentfault.com/a/1190000011068772 查看目录下有什么文件信息 ls //lis ...
- Linux常用指令大全
2017-03-25 16:35:42 刚开始学习Linux,由于记忆力有限,把平时常用的Linux命令整理出来,以便随时查阅: linux 基本命令 ls (list 显示当前目 ...
- linux log日志解析
linux log日志解析 其实,可以说成是监控系统的记录,系统一举一动基本会记录下来.这样由于信息非常全面很重要,通常只有 root 可以进行视察!通过登录文件(日志文件)可以根据屏幕上面的错误 ...
- Linux常用指令(三)
进入京东运维组实习,收到了很多同事的热心指导,自己也努力学习,按照他们给出的学习计划,真的很充实,学到了很多不只是开发方面的知识. 以下简单记录下自己的笔记,方便以后查阅. 1.文件系统 Linux系 ...
- Linux 基础指令初识
Linux 基础指令初识 01. ls 指令 语法: ls [选项] [目录或文件] 功能:对于目录,该命令列出该目录下的所有子目录与文件.对于文件,将列出文件名以及其他信息 -a 列出目录下的所有文 ...
- linux常用指令
整理下来的linux常用指令 mount [-t 文件系统] 设备文件名 挂载点挂载命令,一般用于在挂载ISO,或者其他比如U盘等设备时使用,[-t iso9660]为固定格式,可写可不写,非必写项. ...
- Linux Pthread 深入解析(转-度娘818)
Linux Pthread 深入解析 Outline - 1.线程特点 - 2.pthread创建 - 3.pthread终止 - 4.mutex互斥量使用框架 - ...
随机推荐
- Github 上传代码的两种方式
上传本地代码/文件->Github 折腾了半天时间... Github前期准备部分 1)登录github,新建一个 repository 2)repository 命名 3)Github是一个托 ...
- 用 Python 和 OpenCV 检测图片上的条形码(转载)
原文地址:http://python.jobbole.com/80448/ 假设我们要检测下图中的条形码: # load the image and convert it to grayscale 1 ...
- 20145325张梓靖 《Java程序设计》第8周学习总结
20145325张梓靖 <Java程序设计>第8周学习总结 教材学习内容总结 Logger java.util.logging包提供了日志功能相关类与接口,使用日志的起点是logger类, ...
- ZOJ 3391 Haunted Graveyard(最短路负权回路)题解
题意:好长...从(0,0)走到(w-1,h-1),墓碑不能走,走到传送门只能进去不能走到其他地方,经过传送门时间会变化w(可能为负),其他地方都能上下左右走.如果能无限返老还童输出Never,走不到 ...
- Lucene 基础知识
1. 数据分类 结构化数据: 指具有固定格式或有限长度的数据,如数据库等; 非结构化数据: 指不定长或无固定格式的数据, 如邮件,word 文档等磁盘上的文件; 1.1 非结构化数据查询方法 顺序扫描 ...
- 解决Tomcat端口被占用 及 启用失败等其它错误整理册
使用管理员模式启动命令行工具. netstat -ano|findstr 获取了pid号 taskkill /pid /f 其中6428为pid号,可能有不同. -------- 有时遇到其它问题可以 ...
- SDN原理 OpenFlow协议 -2
本文由SDN原理视频而成:SDN原理 流表 FlowTable --- OpenFlow的核心 问题3 流表项 Flow Entry 单流表(OpenFlow 1.0版本) -> 多流表(Ope ...
- 一年25个里程碑!免疫疗法“战胜”癌症,靠的是实力(5篇Science、6篇Nature )--转载
近几年,免疫疗法的成功使癌症治疗进入了新的时代.无论是科研界,还是商业界,都丝毫没有掩饰对这一领域的热情.2016年,Cell杂志公布的年度十大最佳论文中,免疫疗法占两席.事实上,这两项成果只是去年癌 ...
- codeforces 354 div2 C Vasya and String 前缀和
C. Vasya and String time limit per test 1 second memory limit per test 256 megabytes input standard ...
- Java字符串分割(转)
java.lang.String 的 split() 方法, JDK 1.4 or later public String[] split(String regex,int limit) 示例代码 p ...