Keep folders above files when sorting by name — via Apple Support
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
- 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).
- 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 FinderUndo
defaults delete com.apple.finder _FXSortFoldersFirst; killall FinderSources
- Change Finder settings on Mac — by Apple Support
- Keep folders on top — by Yann Bertrand, macos-defaults.com
- 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.