Guides

How to Show Folders First in Mac Finder

Updated July 28, 2026

Finder can show folders above files, but only in one sort order. Open Finder → Settings → Advanced and tick “Keep folders on top: In windows when sorting by name.” The catch is written into the label — it applies when sorting by name and nowhere else. Sort a window by date, size or kind and folders mix back in with the files.

Show folders first when sorting by name

  1. With Finder active, press ⌘, (or Finder → Settings in the menu bar).
  2. Open the Advanced tab.
  3. Under “Keep folders on top”, tick In windows when sorting by name.

The change applies immediately, in every open window — no restart, no logout.

Keep folders on top on the Desktop

The same Advanced tab has a second checkbox, On Desktop. It’s independent of the first one: the desktop keeps its own arrangement, so if you want folders gathered above files there too, tick both.

The Terminal equivalent

The checkbox writes a single preference, which you can also flip directly:

defaults write com.apple.finder _FXSortFoldersFirst -bool true && killall Finder

killall Finder restarts the Finder process so it re-reads the preference — that step isn’t needed when you use the checkbox. Set it back with -bool false.

Why folders don’t stay on top when you sort by date

Windows Explorer keeps folders on top no matter which column you sort by — date modified, size, or type. Finder’s setting doesn’t: switch a window to Date Modified and folders scatter among the files, ordered purely by their own dates. The same happens in icon view when you choose View → Sort By → anything other than Name.

There is no hidden preference that extends folders-first to the other sort orders. If you browse mostly by name, the built-in option covers you. If you sort by date to answer “what did I touch last?” — a very Explorer habit — Finder has no answer.

Folders first on every sort order

ComfortFiles sorts folders first on every column, exactly as Explorer does: sort by date and you get the newest folders, then the newest files. It’s the default — nothing to configure. That behaviour, along with the folder tree and an address bar Finder does not have, is the point of the app: what else it fixes for switchers.

Frequently asked questions

Can Finder keep folders on top when sorting by date or size?

No. The setting is labelled "Keep folders on top: In windows when sorting by name" — sorting by Date Modified, Size or Kind mixes folders back in with the files, and there is no hidden setting that extends it.

How do I show folders first on the Desktop?

The same Finder → Settings → Advanced tab has a second checkbox, "On Desktop", which keeps folders above files among the desktop icons.

Is there a Terminal command for it?

Yes: `defaults write com.apple.finder _FXSortFoldersFirst -bool true && killall Finder`. It writes the same preference the checkbox does; `killall Finder` is needed for the change to be picked up.

Do I have to restart Finder or my Mac?

No. Ticking the checkbox in Finder Settings applies to every open window immediately. Only the Terminal method needs `killall Finder`.

Can I get the Windows Explorer behaviour, where folders stay on top in every sort order?

Not in Finder itself — it only ever applies folders-first to name sorting. Third-party file managers can do it; ComfortFiles sorts folders first on every column by default.