Ledge

How to select all files of one type in a folder on a Mac

Open the folder in list view, click the Kind column header to sort by type, then click the first file of the type you want and Shift-click the last. Every file of that kind is selected and ready to drag. For folders with subfolders, or for types that do not sort neatly together, a Finder search by kind or extension is more reliable.

Sort by kind and Shift-click

  1. Open the folder and press Command-2 for list view.
  2. Click the Kind column header. If there is no Kind column, Control-click any column header and check Kind.
  3. Scroll to the first file of the type you want and click it.
  4. Scroll to the last one and Shift-click it.

Everything between the two clicks is selected. To confirm the count, choose View > Show Status Bar; the bar at the bottom of the window reports how many items are selected out of the total.

There is one catch. Kind sorts by description, not by extension. JPEG images, PNG images and HEIC images are three different kinds and sit in three different parts of the list, so “all the images” is not a single block. For one exact type, such as every PDF, sorting is all you need. For a family of types, use groups or search.

Group by kind

Groups collect files under broader headings than the Kind column does.

  1. With the folder open, choose View > Use Groups.
  2. Choose View > Group By > Kind.

The window now has sections such as Images, PDF Documents, Movies and Folders. Click the first file in a section and Shift-click the last to take the whole section. Groups work in every view, though list view is the easiest to select in.

Choose View > Use Groups again to turn them off when you are done.

Search by kind or extension

Search is the most precise method, and the only built-in one that reaches into subfolders.

  1. Open the folder and press Command-F.
  2. In the row beginning “Search:”, click the folder’s name so the search covers that folder and not the whole Mac.
  3. In the row below, set the first menu to Kind and the second to the type you want: Image, PDF, Movie, Music, Document and so on.
  4. Press Command-A to select every result.

For an exact extension, choose Other from the first menu, find File extension in the list of attributes, and enter the extension without the dot, for example heic. If you prefer typing, enter kind:pdf in the search field of any Finder window.

Remember that a search looks inside subfolders too. That is ideal when the same type of file is scattered through a project, and a surprise when you only wanted the top level. Choose View > Show Path Bar, then click a result to see where it lives before you move anything.

If you would like searches to start in the current folder every time, set Finder > Settings > Advanced > When performing a search to Search the Current Folder.

Move them with one Terminal command

When the job is simply “every PDF in Downloads goes to this folder,” Terminal does it in one line. Open Terminal from Applications > Utilities and run:

mv -n ~/Downloads/*.pdf ~/Documents/PDFs/

This moves every file ending in .pdf from Downloads into a folder named PDFs inside Documents. The -n tells it never to replace a file that already exists at the destination.

A few things to know before you press Return:

  • The destination folder must already exist.
  • The pattern is case-sensitive. *.pdf skips a file named REPORT.PDF; run the command again with *.PDF to catch those.
  • It covers the top level of the folder only, not subfolders.
  • To preview what the pattern matches, run ls ~/Downloads/*.pdf first. That lists the files without touching them.
  • Command-Z in Finder will not undo a move made in Terminal.

Dragging the selection once you have it

With the files selected, drag any one of them and the rest come along; a badge on the pointer shows the count. A drop on a folder on the same drive moves them, and a drop on another drive copies them. Hold Option to force a copy. Copy, move, or alias when you drag a file on a Mac covers the rules.

The weak point is that a selection is fragile. One click on empty space and it is gone. And the destination is rarely on screen when you finish selecting: the folder has not been made yet, or it is in a window behind three others. So you end up arranging windows around a selection you cannot afford to lose.

Ledge lets you put the selection down. Drag the selected files up to the notch at the top of the screen and let go; they land on a shelf that drops from the notch and stay there. Now you can click wherever you like: make the destination folder, navigate to it, switch to another Space. When it is ready, open the shelf with Option-Space or a click on the notch and drag everything onto the folder. Finder receives the files themselves, so they move there.

The shelf also helps when the same type of file lives in several folders and a search across subfolders would catch too much. Select the ones you want in the first folder, shelve them, move on to the next folder, and drop the whole set at the end. The same files dropped on a chat app upload, and dropped on a terminal they arrive as paths.

To be clear about what it does not do: Ledge does not select or filter files by type, and it does not read or index your folders. Selecting is Finder’s job. The shelf is for holding what you have selected while you sort out where it goes. A tidy way to process a batch of downloads shows the two working together, and how to move files out of subfolders into one folder on a Mac covers the related job of flattening a folder tree.

Questions

Why does sorting by Kind not put all my images together?

Each image format is its own kind, and the column sorts those names alphabetically. Use View > Use Groups with Group By set to Kind, or a search with Kind set to Image, to treat them as one family.

How do I count the files of one type without moving them?

Select them with any method above and read the status bar at the bottom of the window (View > Show Status Bar). In a search window, the status bar shows the number of results.

Is there an extension column in Finder?

No. Kind is the closest column. For an exact extension, use the File extension search attribute, or a pattern such as *.heic in Terminal.