Linux命令cat运用讲解lianxi

Linux命令cat运用讲解lianxi

ID:40558873

大小:46.50 KB

页数:5页

时间:2019-08-04

Linux命令cat运用讲解lianxi_第1页
Linux命令cat运用讲解lianxi_第2页
Linux命令cat运用讲解lianxi_第3页
Linux命令cat运用讲解lianxi_第4页
Linux命令cat运用讲解lianxi_第5页
资源描述:

《Linux命令cat运用讲解lianxi》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、Linux命令cat运用讲解Linux命令cat-concatenatefilesandprintonthestandardoutput把文件连接后输出到屏幕上,其实就是查看文件内容。  你们知道什么是Linux命令么这个非常高深的运用技术将由我来非常讲解,Linux命令NB在哪呢,下面我来进入讲述Linux命令的无限领域。  Linux命令cat-concatenatefilesandprintonthestandardoutput把文件连接后输出到屏幕上,其实就是查看文件内容。  SYNOPSIScat[OPTION][FI

2、LEDESCRIPTIONConcatenateFILE(s),orstandardinput,tostandardoutput.  -A,show-allequivalentto-vET--等同与参数-vET  -b,number-nonblanknumbernonblankoutputlines--对空白行不编号,与-n有相似。  -e,equivalentto-vE--等同与参数-vE  -E,show-endsdisplay$atendofeachline--每行以$符号为行结尾  -n,numbernumberallo

3、utputlines--由1开始对所有输出的行数编号  -s,squeeze-blanknevermorethanonesingleblankline--当遇到连续2行以上的空白行,只保留一行空白行  -t,equivalentto-vT  -T,show-tabsdisplayTABcharactersas^I  -u,(ignored)  -v,show-nonprintinguse^andM-notation,exceptforLFDandTAB  Linux命令练习:  [root@CentOS4ok_008]#catm

4、ytestHelloworld!  Helloworld1  Helloworld2  helloworld3  [root@CentOS4ok_008]#cat-nmytest  Helloworld!  Helloworld1  Helloworld2  helloworld3  [root@CentOS4ok_008]#cat-bmytest  1Helloworld!  2Helloworld1  3Helloworld2  4helloworld3从以上Linux命令我们可以验证-n与-b的差异。  [root@Cen

5、tOS4ok_008]#cat-b-Emytest  1Helloworld!$  2Helloworld1$  3Helloworld2$  4helloworld3$  每行以$符号为行结尾  现在想合并mytest和oktest两个文件的内容成一个新的文件NewTest.txt[root@CentOS4ok_008]#ls-ltotal24-rw-r--r--1rootroot59Sep1819:48mytestdrwxr-xr-x3rootroot4096Sep1322:51ok-rw-r--r--1rootroot21

6、Sep1720:45oktest[root@CentOS4ok_008]#catmytestoktest>>newtest.txt[root@CentOS4ok_008]#ls-ltotal32-rw-r--r--1rootroot59Sep1819:48mytest-rw-r--r--1rootroot80Sep1819:53newtest.txtdrwxr-xr-x3rootroot4096Sep1322:51ok-rw-r--r--1rootroot21Sep1720:45oktest查看新的文件newtest.txt的内

7、容:[root@CentOS4ok_008]#cat-bnewtest.txt  1Helloworld!  2Helloworld1  3Helloworld2  4helloworld3  5thisisatestfile. 合并两个文件的内容[root@CentOS4ok_008]#catmytestoktest>newtest1.txt[root@CentOS4ok_008]#ls-ltotal40  -rw-r--r--1rootroot59Sep1819:48mytest  -rw-r--r--1rootroot80

8、Sep1819:56newtest1.txt  -rw-r--r--1rootroot80Sep1819:53newtest.txt  drwxr-xr-x3rootroot4096Sep1322:51ok  -rw-r--r--1rootroot21Sep17

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。