Skip to content

Keep folders above files when sorting by name — via Apple Support

Hidden settinglow riskmacOS 14 Sonoma and later

Normally Finder mixes folders and files together alphabetically. With this on, folders are listed first, then files, the way Windows Explorer does it. It can be set for windows and, separately, for the desktop.

Relaunch the app it changes (Finder, Dock…) to see it

The easy way

  1. The easy way: Finder > Settings > Advanced, then under Keep folders on top tick In windows when sorting by name (and On Desktop if you want it there too).
  2. Or in Terminal run the command (it sets the windows option).

Command

Run in Terminal (Applications › Utilities).

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

Undo

defaults delete com.apple.finder _FXSortFoldersFirst; killall Finder

Sources

Source reviewed
2026-11-02
Link checked
2026-11-02
Tested hands-on
Not by Oddbyte.Me

Oddbyte.Me hasn't tried this on every macOS version, so keep the undo handy.

folders firstsortfinderfolders on top

More in Finder