cp命令不覆盖求助

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
you6636
帖子: 3
注册时间: 2009-12-02 18:30

cp命令不覆盖求助

#1

帖子 you6636 » 2018-05-10 20:28

比如我要对下载更新文件夹进行备份,我用下面命令
sudo cp -r /var/cache/apt/archives /mnt/d/system/ubuntu-win10我已复制了,下次又要复制不覆盖已复制的文件命令怎么打,意思是跳过已有的文件,只复制新更新的文件。
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: cp命令不覆盖求助

#2

帖子 poloshiao » 2018-05-10 21:04

http://manpages.ubuntu.com/manpages/bio ... /cp.1.html
cp - copy files and directories

-n, --no-clobber
do not overwrite an existing file (overrides a previous -i option)

-i, --interactive
prompt before overwrite (overrides a previous -n option)
头像
kingkongmok
帖子: 340
注册时间: 2006-03-23 14:48

Re: cp命令不覆盖求助

#3

帖子 kingkongmok » 2018-05-15 16:23

man rsync
-u, --update skip files that are newer on the receiver
回复