mv equivalent rsync command [closed]

余生颓废 提交于 2019-12-20 09:54:09

问题


i'm trying to move folders to another folders using command line, with overwrite if already exists, but i got error "Is a directory" when using mv..

example:

mv src/test/ dest/

there are many files and folders on src/test/, there are also some files and some folders on dest/

and i want files and folders on dest/ replaced with files and folder from src/test/ if exists, example:

src/test/bla/boo replaces dest/bla/boo
src/test/bla/bla/boo replaces dest/bla/bla/boo

also, everytime one file transfer completed, that one file deleted from src/test/

and overall transfer progress bar would be fine..

what rsync flag should i use to make this happend?


回答1:


The following command line should achieve what you want:

$ rsync -a --progress --remove-source-files src/test/ dest


来源:https://stackoverflow.com/questions/9849794/mv-equivalent-rsync-command

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!