mv equivalent rsync command

Kokizzu picture Kokizzu · Mar 24, 2012 · Viewed 17.2k times · Source

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?

Answer

Frédéric Hamidi picture Frédéric Hamidi · Mar 24, 2012

The following command line should achieve what you want:

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