Linux下默认cp命令是有别名(alias cp=‘cp -i’)的,无法强制覆盖
1、使用\cp执行cp命令时不走alias 
[root@k8smaster01 ~]# \cp test1.log  test2.log

2、使用管道
[root@k8smaster01 ~]# yes | cp test1.log test2.log

3、取消cp的alias
[root@k8smaster01 ~]# unalias cp
[root@k8smaster01 ~]# cp test1.log  test2.log

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐