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 >System Tutorial >LINUX >Solution to CentOS file overwriting problem
[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!