dired-compare-directories

dired-compare-directories is an interactive autoloaded compiled Lisp function in `dired-aux.el'.


(dired-compare-directories DIR2 PREDICATE)

Mark files with different file attributes in two dired buffers.
Compare file attributes of files in the current directory
with file attributes in directory DIR2 using PREDICATE on pairs of files
with the same name. Mark files for which PREDICATE returns non-nil.
Mark files with different names if PREDICATE is nil (or interactively
with empty input at the predicate prompt).

PREDICATE is a Lisp expression that can refer to the following variables:

size1, size2 - file size in bytes
mtime1, mtime2 - last modification time in seconds, as a float
fa1, fa2 - list of file attributes
returned by function `file-attributes'

where 1 refers to attribute of file in the current dired buffer
and 2 to attribute of file in second dired buffer.

Examples of PREDICATE:

(> mtime1 mtime2) - mark newer files
(not (= size1 size2)) - mark files with different sizes
(not (string= (nth 8 fa1) (nth 8 fa2))) - mark files with different modes
(not (and (= (nth 2 fa1) (nth 2 fa2)) - mark files with different UID
(= (nth 3 fa1) (nth 3 fa2)))) and GID.