Northern Commander

Bring two folders in line

You end with two folders that hold the same files — a project and its backup, say — having seen every difference first, and with anything that was replaced or deleted still in the Trash.

1. A folder in each pane

Take the left pane to the folder you work in and the right pane to its copy. Tab moves between them, and Going places has the ways to a folder.

2. See what differs

⌃⇧S lines the two panes up row for row and colors what is different.

Green is on one side only, magenta is on both and different, and a blank line is where a side has nothing.
  • Green is on this side only. Opposite it, the other pane has a blank line.
  • Magenta is on both sides, and the two differ in size or date.
  • A folder both sides have is not colored. Go into it and it is compared in its turn; the other pane comes with you.

Nothing is read to do this, so it is immediate. ⌃⇧S again lets the panes go. More: Live compare.

3. Check a file you are unsure of

With the cursor on a magenta row, ⌥F3 and Enter shows the two files change by change. F8 sets them next to each other, and ⌘↓ steps through. Esc comes back to the panes.

This is where you find the file that is newer in the backup because you fixed something there. Note it for the next step. More: Comparing two files.

4. Plan it

Synchronize folders…, under Compare in the Commands menu, asks for the two folders — filled in from the panes — and how to tell two files apart. Size and date is what live compare used. Compare starts it.

The view lists every difference at every depth, with nothing planned. F4 fills the plan: choose Both ways, and Fill. What either side is missing is copied to it, and the newer of two files replaces the older.

Each arrow is one copy. The line at the bottom adds the plan up.

Then read it. The column between the two sides is the plan for each row:

  • → copies to the right and ← to the left. The file from step 3 goes left, since the backup’s is the newer.
  • A row only one side has is copied to the other. If you deleted it on purpose, F8 on the row plans to delete it instead, or F7 leaves it alone.
  • F5 and F6 set a row to the right or to the left yourself.
  • F3 compares the two files of a row, as in step 3.

A row you set yourself is kept if you fill again.

5. Apply it

F2 says what the plan comes to before anything happens: how many files are new, how many are written over and how many are deleted, and how many of those written over are newer than what replaces them.

Read the counts. Enter does not answer this one.
  • Leave Keep replaced files in the Trash ticked. A file is then moved to the Trash before it is written over, so the old one can be had back.
  • What is deleted goes to the Trash too.
  • Enter does not answer the question: choose Apply.

It runs like any copy: it can be paused, stopped or sent to the background. See Synchronizing folders.

6. Check what it did

When it ends the view compares the folders again and stays open, now with nothing left to do. ⇧⌘J has every step, and anything it left alone with the reason. The Trash holds what was replaced, each row saying where it came from.

Variations

  • Only what is missing. Compare folders…, under Compare in the Commands menu, marks what differs in both panes; F5 then takes the marked files across, and asks about each one already there. See Marking what differs.
  • One file at a time. In live compare, F5 with the cursor on a blank line copies the other pane’s file into the gap.
  • Make one side match the other. In step 4 fill To the right instead. What the right side is missing is copied to it and what differs there is replaced, whatever its date — a row that puts an older file over a newer one is marked →!. What only the right side has is left, unless you tick Also delete what the other side does not have.
  • When dates cannot be trusted. Choose Contents in step 4. Both files are read, which takes as long as reading them does.
  • Just walking the two. ⌃S ties the panes together without comparing anything: go into a folder and the other pane goes into the one of the same name.