6
为什么将cp设计为以静默方式覆盖现有文件?[关闭]
我cp使用以下命令进行了测试: $ ls first.html second.html third.html $ cat first.html first $ cat second.html second $ cat third.html third 然后我复制first.html到second.html: $ cp first.html second.html $ cat second.html first 该文件将second.html被静默覆盖,没有任何错误。但是,如果我在桌面GUI中通过拖放具有相同名称的文件来执行此操作,则该文件将first1.html自动添加后缀。这样可以避免意外覆盖现有文件。 为什么不cp遵循这种模式,而不是默默地覆盖文件?