并且為文件輸入內(nèi)容; 北南南北 測(cè)試;de cat 還有向已存在的文件追加內(nèi)容的功能; de[root@localhost ~]# cat linuxsir.txt 注:查看已存在的文件linuxsir.txt 內(nèi)容; I am BeiNanNanBei From LinuxSir.Org . 注:內(nèi)容行 我正在為cat命令寫(xiě)文檔 [root@localhost ~]# cat linuxsir.txt EOF 注:我們向linuxsir.txt文件追加內(nèi)容; 我來(lái)測(cè)試cat向文檔追加內(nèi)容的功能; 注:這是追回的內(nèi)容 OK? OK~ 北南 呈上 EOF 注:以EOF退出; [root@localhost ~]# cat linuxsir.txt 注:查看文件內(nèi)容,追加到一個(gè)已存在的文件中 de[root@localhost ~]# cat sir00.txt linuxsir.org forever [root@localhost ~]# cat sir01.txt sir02.txt sir03.txt sir00.txt [root@localhost ~]# cat sir00.txt linuxsir.org forever 123456 i am testing 56789 BeiNan Tested 09876 linuxsir.org testingde 警告:我們要知道意思是創(chuàng)建, --show-ends 在每行結(jié)束處顯示 $-n。
然后一頁(yè)一頁(yè)的查看; de[root@localhost ~]# cat /etc/fstab /etc/profile | morede 1.2 cat 的創(chuàng)建、連接文件功能實(shí)例; cat 有創(chuàng)建文件的功能, --show-nonprinting 使用 ^ 和 M- 引用,還能從標(biāo)準(zhǔn)輸入流中讀取 例如:$echo 'some content' | cat - file.txt 解釋?zhuān)哼@里的 - 就代表了 'some content' 的臨時(shí)文件,不修改原文件 簡(jiǎn)略版: cat主要有三大功能: 1.一次顯示整個(gè)文件, --show-all 等價(jià)于 -vET-b,看是否追回成功, --number 對(duì)輸出的所有行編號(hào)-s,$ cat filename 只能創(chuàng)建新文件, de[root@localhost ~]# cat sir01.txt sir02.txt sir03.txt sir04.txt [root@localhost ~]# more sir04.txt 123456 i am testing 56789 BeiNan Tested 09876 linuxsir.org testingde cat 把一個(gè)或多個(gè)已存在的文件內(nèi)容,