I've two RFS (RFS = Root File System) directories, which I would like to compare to each other with diff. Both directories represent an RFS of some other system, and they may contain links. If those links are absolute, they will point to something useless.

For example, I've one RFS with the following symlink (inside the RFS):

/usr/test -> /home/test/file1

Now I've this complete RFS inside a directory named /home/user/compare, and the absolute paths of both files mentioned above are


Clearly, the symlink /home/user/compare/usr/test doesn't point to the right file. And because of that a comparison with the files in /home/usr/compare with some other RFS directory will fail for those symlinks.

Is it possible to setup diff so it assumes not / as root but /home/user/compare as root (for the comparison), so that the given absolute symlink points to something valid, and diff takes it into account?

Maybe there is a similar Linux command I can use for that?

  • what do you mean by rfs? – umläute Nov 11 '13 at 15:55
  • in any case, the symlinks are not evaluated by diff, but instead by the kernel, so no, diff should not be able to do as you requested. – umläute Nov 11 '13 at 15:59
  • rfs = root file system. This is being used when working to create/change/... a complete root filesystem, which is being used within a different system. You might have one in /home/user/subsystem which contain directories like usr, bin, home, etc, var, lib... – Alex Nov 12 '13 at 10:14

Your Answer


Browse other questions tagged or ask your own question.