I have a directory with many files in it.  The only ones I care about are those with the extension .jar.  However, there are other files in the directory as well.I have a source directory with only .jar files.  I want to achieve the equivalent of:rm destdir/*.jarcp sourcedir/*.jar destdirHowever, I want to do this without actually removing the files that are already there, if they are the right files already.In other words, I want it to be possible to run a single command that will:For any .jar files present in sourcedir but not in destdir, copy them over.For any .jar files present in both sourcedir and destdir, ensure that the copy in destdir matches the copy in sourcedir and overwrite it if it doesn't.For any .jar files present in destdir but not in sourcedir, delete the file.For any other files present in destdir (without a .jar extension), ignore themdo not delete them or change them.It seems that this should be possible with rsync.  How can I do this?
How to use rsync to force all *.jar files to match?
rsync;file copy;synchronization