CentOS下如何避免文件覆盖?

2023-12-04 0 383

[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

如果要取消限制,就把set -o 改为set +o

[root@stu227 he]# set +o noclobber

[root@stu227 he]# echo "123" > he.txt

[root@stu227 he]# cat he.txt

123

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

悠久资源 RedHat/Centos CentOS下如何避免文件覆盖? https://www.u-9.cn/system/redhatcentos/82034.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务