linux input redirection and appending (> >>)

Output redirection and append
Output redirection and >> append
Basic syntax

1) `ls -l >文件`     (功能描述:列表的内容写入文件中(覆盖写),文件不存在就自动创建)
2) `ls -al >>文件`      (功能描述:列表的内容追加到文件的末尾)
3) `cat 文件1 > 文件2` (功能描述:将文件1的内容覆盖到文件2,文件不存在就自动创建)
4) `echo "内容">> 文件` (功能描述:将“内容”追加到文件,文件不存在就自动创建)

The content of the list is appended to the end of the file
Insert picture description here
Insert picture description here
Append and content overwrite
Insert picture description here

Guess you like

Origin blog.csdn.net/qq_43674360/article/details/111308044