How freedup works

  1. scan all directory trees recursively for all regular files
  2. build a list of those files and keep their name, lstat() and arg position
  3. sort the files by comparing their sizes using qsort()
  4. in case the comparison has to report equal file size additional properties are compared
  5. most property checks have to be added using command line options
  6. if all demands are fullfilled, the files are compared block by block (4k)
  7. if both files are identical and on the same file system they will be renamed, hard linked, renamed file removed.
  8. if hardlinking is not possible soft links are tried, except one of the paths is not starting at root (but can be forced)
  9. sorting is repeated, the reason why it is needed was not checked yet
  10. finally a short report is delivered