Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to avoid file overwriting under CentOS

Shulou Source: shulou.com Published: 2022-06-01 17:45:22 09月30日 Update

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!

Tags: Documents content articles learning help examples easy to understand more organization knowledge editing industry information information channels channels research restrictions Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Huawei Apple NVidia MySQL