How to avoid file overwriting under CentOS
This article mainly shows you "how to avoid file coverage under CentOS", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to avoid file coverage under CentOS" this article.
Examples are as follows
[root@stu227 he] # touch he.txt
[root@stu227 he] # set-o noclobber
[root@stu227 he] # echo "123" > he.txt
Bash: he.txt: cannot overwrite existing file
If you want to remove the restriction, change set-o to set + o
[root@stu227 he] # set + o noclobber
[root@stu227 he] # echo "123" > he.txt
[root@stu227 he] # cat he.txt
one hundred and twenty three
The above is all the contents of the article "how to avoid file overwriting under CentOS". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!