Forbid output redirection to avoid overwrite the existing file
在输出重定向中,>
表示重定向并覆盖已有文件内容,为了防止误操作,覆盖重要的内容,可以使用如下命令
set -C
这样输出重定向到一个已有文件就会提示
cannot overwrite existing file
如需强制覆盖,可以使用符号>|
来实现
>|
关闭这一功能可以使用
set +C
Disclaimer
- License under
CC BY-NC 4.0
- Copyright issue feedback
me#imzye.me
, replace # with @ - Not all the commands and scripts are tested in production environment, use at your own risk
- No privacy information is collected here