<div class="gmail_quote">On Sat, Nov 6, 2010 at 4:35 AM, Edvinas Valatka <span dir="ltr">&lt;<a href="mailto:edacval@gmail.com">edacval@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">rsync -a -vv -i -W --remove-source-files dir1/ dir2/</div></blockquote><div><br></div><div>You&#39;d need to also specify --ignore-non-existing to avoid adding any new files into dir2.  Also, -W is assumed in a local transfer, and two -v opts is probably overkill -- two -i opts would be better.</div>
<div><br></div><div>However, the ammended command would still update the matching filenames in dir2 if they differ in dir1 (in size or mtime), which might not have been the original intent.  If that is a problem, writing a shell script is probably a better idea:</div>
<div><br></div><div>#!/bin/sh</div><div>cd /dir1</div><div>for file in *; do</div><div>    if -f &quot;$file&quot; &amp;&amp; -f &quot;/dir2/$file&quot;; then</div><div>        rm &quot;$file&quot;</div><div>    fi</div><div>
done</div><div><br></div></div>..wayne..<br>