Using find command to search for files in one directory which are not in the other, then move them

52 views Asked by At

I would like to be able to use the GNU find command in BASH to find any exact filenames in somedir_v1 that do NOT match any filenames in somedir_v2, and then move those files from somedir_v1 into newdir_v1

The thing is, while I could just copy somedir_v2 over somedir_v1, and have newer versions of certain files, both of these directories have 40GB files. I also don't even know if access time (atime) will update when I move them, so I might not know what files were previously inside, what files were replaced and what wasn't replaced. Anyway, I'm not going to do it this way.

If there's a bash line I can use, please let me know. Thank you.

0

There are 0 answers