環境:用戶家目錄空文件
[xiaoshuai.zhu@localhost ~]$ pwd
/home/xiaoshuai.zhu
[xiaoshuai.zhu@localhost ~]$ ll
total 0
測試cat結合EOF實現文件新增
[xiaoshuai.zhu@localhost ~]$ cat << EOF >/home/xiaoshuai.zhu/note1.txt
測試cat結合EOF實現文件新增
EOF
查看文件內容
[xiaoshuai.zhu@localhost ~]$ cat note1.txt
測試cat結合EOF實現文件新增
實現內容替換
[xiaoshuai.zhu@localhost ~]$ cat << EOF >/home/xiaoshuai.zhu/note1.txt
測試cat結合EOF實現文件的內容的替換覆蓋
EOF
查看文件內容
[xiaoshuai.zhu@localhost ~]$ cat note1.txt
測試cat結合EOF實現文件的內容的替換覆蓋