"Clean-Up By Name" on all folders on Mac Is there a command that I can run in Terminal which will Clean-Up By Name on all folders. It is bit of a job going into each folder and doing this.
If you want to always keep icon views sorted by name, open the view options for some folder in icon view, set Arrange By to None and Sort By to Name, and press the Use as Defaults button.

The default settings don't apply to folders that have folder-specific settings saved in a .DS_Store file, so you might also want to delete .DS_Store files:

sudo find / -name .DS_Store -delete; killall Finder


Deleting .DS_Store files:


Resets folder-specific view options, including the sort by and arrange by modes
Removes Spotlight comments from Finder's information windows (but not the extended attributes for Spotlight comments)
Resets the positions and shown parts of windows
Resets the positions of icons and custom backgrounds in icon view