If you required that, you would need a second find pass to identify all the symlinks and then explicitly check for their existence in b. since we are skipping symlinks entirely, this won't notice if symlink names are not present in b.This will identify files that differ in content, or files which are in a but not in b. Or as a one-liner: for f in `find a/* ! -type l` do diff -rq $f b/$ done Pass your directories a and b in as arguments: #!/bin/bash If you really want to do this with diff, then you can use find to skip the symlinks, and run diff on each file individually. If you don't want to do that, then check-summing the directory may be sufficient. If all you want is to verify an rsync (and presumably fix what's missing), then you could just run the rsync command a second time.
To, diff outputs the difference between the two files, instead ofĭiff should optionally report changes to special files specially,Īnd patch should be extended to understand these extensions. For example, if you change which file a symbolic link points This means that patch cannot represent changes to suchįiles. It treats other special files like regular files if they are specifiedĪt the top level, but simply reports their presence when comparingĭirectories. Currently, diff treats symbolic links like regular files Some files are neither directories nor regular files: they are unusualįiles like symbolic links, device special files, named pipes, and
Unfortunately, older versions of diff don't support ignoring symlinks: For version 3.3 or later of diff, you should use the -no-dereference option, as described in Pete Harlan's answer.