Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have moved (mv) a pretty large directory on my NAS (Linux based), but had to interrupt the procedure. Not being a regular Linux user, I though I could just continue and merge the rest later in.

mv /oldisk/a /newdisk

Procedure is halfway done, so rest of /oldisk/a still exists, and /newdisk/a with the already copied files is already present. I have no idea which files have been already copied. BTW, under /oldisk/a, of course, are plenty of sub directories.

What would be the best way to move / merge the remaining files to /newdisk/a ?

share|improve this question
up vote 18 down vote accepted

rsync --verbose --archive --dry-run /oldisk/a/ /newdisk/a/

The --dry-run (or -n) will do a dry run, showing you what it would do without actually doing anything.

If it looks ok, run the rsync without the -n option.

This will be a copy, not a move, which isn't quite what you're doing, but is safer. The --archive (or -a) ensures all the ownership and timestamps metadata is preserved (which a regular copy would not).

share|improve this answer
Copy is OK, can always remove the old directory later. – Horst Walter Jun 1 '12 at 16:02
You can use --remove-source-files to delete the files that have been successfully copied. Also, -P or --progress will show an estimate of how many more files there are to do. – deltab May 5 '14 at 2:43
so as an example of a move: rsync --remove-source-files --recursive --times --crtimes 1/* 2/ – user7000 Oct 7 '14 at 4:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.