我试过的:
root@host [/home1]# cp -f hello /home3
cp: omitting directory `hello'
root@host [/home1]# cp -rf hello /home3
cp: overwrite `/home3/hello/.buildpath'? y
cp: overwrite `/home3/hello/.bash_logout'? y
cp: overwrite `/home3/hello/.project'? ^C
Run Code Online (Sandbox Code Playgroud)
他们总是问我是否要覆盖。使用 mv 也不起作用。所以我该怎么做?
我尝试过的其他事情:
root@host [/home1]# cp -rf hello /home3
cp: overwrite `/home3/hello/.buildpath'? y
cp: overwrite `/home3/hello/.bash_logout'? y
cp: overwrite `/home3/hello/.project'? ^C
root@host [/home1]# cp -force hello /home3
cp: invalid option -- 'o'
Try `cp --help' for more information.
root@host [/home1]# cp --remove-destination hello /home4
cp: omitting directory `hello'
root@host [/home1]# cp --remove-destination hello /home3
cp: omitting directory `hello'
root@host [/home1]# cp --remove-destination -r hello /home3
cp: overwrite `/home3/hello/.buildpath'? ^C
root@host [/home1]#
Run Code Online (Sandbox Code Playgroud)
Chr*_*own 14
cp
似乎是引起问题的东西的别名,或者它是一个函数。您可以删除别名/函数:
unalias cp
unset -f cp
Run Code Online (Sandbox Code Playgroud)
如果您现在只想覆盖它,您可以使用该command
命令覆盖任何别名/函数定义:
command cp [...]
Run Code Online (Sandbox Code Playgroud)
如果您希望完全删除它,您可能需要查看 bash 启动文件。
sin*_*anu 14
要强制覆盖而不询问您应该使用命令mv和选项“-f”,使用 man 查看选项。
男人MV:
-f, --force
do not prompt before overwriting
Run Code Online (Sandbox Code Playgroud)
例子:
mv -f test.tmp test.txt
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
98945 次 |
最近记录: |