在shell中
>為創建: echo “hello shell” > out.txt
>>為追加:echo “hello shell” >> out.txt
當out.txt 文本不存在時,'>'與‘>>’都會默認創建out.txt文本,並將hello shell 字符串保存到out.txt中
當out.txt文本存在時,‘>’會將out.txt文本中的內容清空,並將hello shell 字符串存入
而‘>>’會將 hello shell追加保存到out.txt的末尾
在shell中
>為創建: echo “hello shell” > out.txt
>>為追加:echo “hello shell” >> out.txt
當out.txt 文本不存在時,'>'與‘>>’都會默認創建out.txt文本,並將hello shell 字符串保存到out.txt中
當out.txt文本存在時,‘>’會將out.txt文本中的內容清空,並將hello shell 字符串存入
而‘>>’會將 hello shell追加保存到out.txt的末尾
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。