Skip to content

How to automatically sort files into folders by type on a Mac

By Suraj, Unloop Studio · Updated

Short answer

For a quick look, use Finder’s Group By › Kind. To actually move files into folders like Videos, Images and Audio, use a short Terminal command or an Automator Folder Action. If you do this every day with your own folder names and rules, a small custom tool turns it into one click.

1. Group by kind in Finder (view only)

This only changes how files are displayed — nothing is moved.

  1. 1Open the folder in Finder.
  2. 2Choose View › Use Groups.
  3. 3Choose View › Group By › Kind.

2. Smart Folders (saved searches)

Smart Folders always show matching files, but the files stay where they are.

  1. 1In Finder choose File › New Smart Folder.
  2. 2Click + and set “Kind is Movie” (or Image, Music, PDF…).
  3. 3Save it to the sidebar.

3. Move files by extension with Terminal

Open Terminal, go to the folder with cd, then run:

mkdir -p Videos Images Audio Documents
mv *.mov *.mp4 Videos/ 2>/dev/null
mv *.jpg *.jpeg *.png *.heic Images/ 2>/dev/null
mv *.wav *.mp3 *.m4a Audio/ 2>/dev/null
mv *.pdf *.docx Documents/ 2>/dev/null

4. Automator Folder Action

Automator can run a workflow whenever files are added to a folder (New › Folder Action). Combine “Filter Finder Items” with “Move Finder Items” to route files by kind. It works, but gets fiddly once you need several rules, subfolders or naming.

FAQ

Can a Mac sort files into folders automatically?

Yes. Finder can group files for viewing, and Automator Folder Actions or Terminal commands can move them into folders by type. A custom tool can combine this with your own naming and folder rules.

Is there a way to undo a Terminal move?

Not automatically. Test commands on a copy of the folder first.