linux常用命令--cat

时间:2014-07-05 20:07:15   收藏:0   阅读:222

cat 可以将文件输出到屏幕或者 > 输出到文件

常用参数:

cat -n filename 将文件filename 编号显示

如:

cat -n test.txt
1 1@qq.com
2 2@qq.com
3 3@qq.com
4 4@qq.com
5 5@qq.com
6 6@qq.com

 

cat -b filename 编号显示,空白行不编号

 

再如:

cat -n textfile1 > textfile2 讲textfile1内容加编号之后存到textfile2中

 

cat /dev/null > filename 清空文件内容

 

linux常用命令--cat,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!