Linux使用

来源:互联网 发布:ext js anchor 编辑:程序博客网 时间:2024/04/30 05:08

RedHat5

【cat】 

将一个文件内容加入到另外一个另外一个文件中

参数

-n 或 --number 由 1 开始对所有输出的行数编号 

-b 或 --number-nonblank 和 -n 相似,只不过对于空白行不编号

-s 或 --squeeze-blank 当遇到有连续两行以上的空白行,就代换为一行的空白行

例子

cat -n textfile1 > textfile2 把 textfile1 的档案内容加上行号后输入 textfile2 这个档案里

cat -b textfile1 textfile2 >> textfile3 把 textfile1 和 textfile2 的档案内容加上行号(空白行不加)之后将内容附加到 textfile3 里。

http://linux.chinaitlab.com/command/11254.html

 

 

 

原创粉丝点击