码迷,mamicode.com
首页 > 系统相关 > 详细

Linux cat命令

时间:2016-05-17 19:20:12      阅读:200      评论:0      收藏:0      [点我收藏+]

标签:

介绍

cat命令经常会用来查看一个文件的内容,并且结合它本身的一些参数经常可以用来做一些特殊的内容处理。

 

 

参数

Usage: cat [OPTION]... [FILE]...
Concatenate FILE(s), or standard input, to standard output.

  -A, --show-all           等同于使用参数-vET
  -b, --number-nonblank    针对非空行显示行号
  -e                       等同于使用参数 -vE
  -E, --show-ends          每行以$结尾-n, --number             每行都显示行号
  -s, --squeeze-blank      将连续的多个空行以显示一个空行
  -t                       等同于使用参数 -vT
  -T, --show-tabs          制表符(tab)以^I符合代替
  -u                       (ignored)
  -v, --show-nonprinting   use ^ and M- notation, except for LFD and TAB
      --help     display this help and exit
      --version  output version information and exit

With no FILE, or when FILE is -, read standard input.

Examples:
  cat f - g  Output fs contents, then standard input, then gs contents.
  cat        Copy standard input to standard output.

 

1.查看多个文件内容

技术分享

2.显示行号

技术分享

3.压缩空行

技术分享

4.不显示空行

技术分享

 

总结

 

 

 

 

备注:

    作者:pursuer.chen

    博客:http://www.cnblogs.com/chenmh

本站点所有随笔都是原创,欢迎大家转载;但转载时必须注明文章来源,且在文章开头明显处给明链接。

《欢迎交流讨论》

Linux cat命令

标签:

原文地址:http://www.cnblogs.com/chenmh/p/5489850.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!