Northern Commander

Gather files from a folder tree

You end with every photo from a deep tree of folders — an old laptop’s, a camera card’s, a project’s — in one place: either all in one folder, or copied with the folders they were in and nothing else.

Before either, stand in the tree you are gathering from in the active pane, and put the folder they are going to in the other pane.

Into one folder

1. Find them

⌘F. Where already says ., the folder you are in.

  • Name matches — *.jpg;*.jpeg;*.heic. Capitals and small letters are alike, so DSC_0043.JPG is found too.
  • Skip dirs — Library, or whatever holds pictures you do not want: caches, thumbnails.
Photos of three kinds, leaving out the Library folder and hidden files.

Find starts it. Finding files has every other box: size, date, what a file contains.

2. Make the results the pane, and copy them

  1. Show all in a pane on the results makes them the pane: each photo with the folder it was found in. More arrive while the search runs.
  2. ⌘A marks them.
  3. F5, and Enter. They all go into the one folder in the other pane.
The results are files like any others: mark them all, and copy.

3. Two of the same name

Two photos of one name from different folders meet in the one folder, and the second is asked about.

Both are photos you want, so keep both.

Rename and keep both keeps the second as IMG_4127 copy.heic. Tick Apply to all first and every later one is answered the same way. Copying and moving has the other answers.

Keeping the folders

When where each photo was matters, skip the search and let the copy choose.

  1. Mark the folders you are gathering from, or ⌘A for the whole tree.
  2. F5, and tick Only files, in every subfolder, that. Leave it on match and type *.jpg;*.jpeg;*.heic.
  3. Enter.
Only the photos go, at every depth, each in the folder it was in.

The photos arrive in the same folders they were in. Only folders that hold a photo are made, so a folder with none — Downloads, here — does not appear at all.

Variations

  • Move instead. F6 takes the same Only files choice, and leaves each folder behind with whatever was not taken.
  • Clear a kind out of a tree. F8 takes it too: with *.tmp, only the temporary files go, at every depth, and everything else stays. See Deleting.
  • See where one came from. On a result, ⇧⌘E goes to its folder with the cursor on it; ⌘[ returns to the results as they were. ⌘E opens the folder in the other pane instead.
  • Keep the search. Save on the results keeps it under a name, in Saved searches in the places list (⌥F1). It keeps the question, not the files, so next time it finds what is there then.
  • Faster, from the index. ⇧⌘F asks the index macOS keeps, which answers at once and has Show all in a pane too — but leaves out hidden files and what the index does not cover.