he.txtbash:he.txt:cannotoverwriteexistingfile If you want to cancel the restriction, change set-o to set+o[root@stu227he]#set+onoclobber[root@stu227he]#echo"123">he.txt[root@stu227he]#c"/> he.txtbash:he.txt:cannotoverwriteexistingfile If you want to cancel the restriction, change set-o to set+o[root@stu227he]#set+onoclobber[root@stu227he]#echo"123">he.txt[root@stu227he]#c">

Home  >  Article  >  System Tutorial  >  Solution to CentOS file overwriting problem

Solution to CentOS file overwriting problem

王林
王林forward
2024-01-03 16:34:24598browse

[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 cancel 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

123

The above is the detailed content of Solution to CentOS file overwriting problem. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:jb51.net. If there is any infringement, please contact admin@php.cn delete