compare two folders

Find which files differ between two folders, or are only in one of them.

  • files
  • text

Steps

  1. diff -rq dir1 dir2

    the files that differ, and those only in one

  2. diff -r dir1 dir2

    the same, with the lines that differ

  3. diff -u old.txt new.txt

    two files, the changed lines in context

  4. rsync -rcn --out-format='%n' dir1/ dir2/

    what a copy from dir1 would change in dir2, by content

Notes

  • meld, if installed, shows the same side by side.

Commands used

  • diff
  • rsync
  • cmp

Each has a page in lore: lore diff opens it.