Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Is it possible to compare two directories with rsync and only print the differences? There's a dry-run option, but when I increase verbosity to a certain level, every file compared is shown.

ls -alR and diff is no option here, since there are hardlinks in the source making every line different. (Of course, I could delete this column with perl.)

share|improve this question

1 Answer 1

up vote 4 down vote accepted

You will propably have to run something like rsync -avun --delete in both directions.

But what are you actually trying to accomplish?

Update:

rsync -avun --delete $TARGET $SOURCE |grep "delete" will give you a list of files that do not exist in the target-directory.

rsync -avun $SOURCE $TARGET will give you a list of "different" files (including new files).

share|improve this answer
    
I want to list all files that are in the source but not in the target directory. All modified files should be listed too. –  chris Dec 3 '12 at 18:55
    
@chris I updated my answer. Is this what you are searching for? –  Nils Dec 4 '12 at 21:26
    
Yes that's it. Thank you. –  chris Dec 6 '12 at 17:23

Your Answer

 
discard

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.