Mac desktop icons: organizing a layout that resets
You spent ten minutes dragging desktop icons into columns that made sense. Then a monitor was unplugged, or the machine woke from sleep, and everything snapped back into a single ragged stack along the right edge. That is not a bug you can fix by dragging harder. The desktop layout is state that lives in a specific place, gets keyed to a specific screen geometry, and gets overwritten by three different menu commands that most people treat as synonyms. Sorting out which layer you are actually touching is the whole job.
Three commands in the View menu, three different jobs
Click the desktop and open the View menu. Three entries sit next to each other: Clean Up, Clean Up By, and Sort By. They produce similar looking results the first time each one is used, which is exactly why the layout keeps coming undone afterwards.
Clean Up is a one shot action. It takes the icons where they currently sit and snaps each one to the nearest free grid position. Nothing is reordered. A file you deliberately parked in the bottom left stays roughly in the bottom left, just aligned. The moment a new file lands, it goes wherever the system finds room, and the tidiness decays from that point.
Clean Up By is also a one shot action, but it reorders as well as aligns. Pick Name or Kind and the icons are laid out in that order starting from the top right. After it runs, you are free to drag icons anywhere again, and the order is not maintained.
Sort By is the one that is not a one shot action. It is a persistent mode. While it is set to anything other than None, icons are kept in that order permanently and dragging is disabled. You can drop a file on the desktop and it will insert itself into position instead of landing where the cursor was. People switch this on, discover they can no longer place anything by hand, and conclude the desktop is broken.
| Command | Runs once or stays on | Reorders | Dragging still works |
|---|---|---|---|
| Clean Up | Once | No | Yes |
| Clean Up By | Once | Yes | Yes |
| Sort By | Stays on | Yes | No |
| Use Stacks | Stays on | Groups instead | Only within a stack |
The practical read is simple. If you want icons where you put them, use Clean Up and accept that it needs redoing. If you never want to think about placement again, use Sort By and stop trying to drag.
Where the arrangement is actually stored
Every folder that has ever been opened in a Finder window carries a hidden file named .DS_Store holding that folder's view state: view mode, icon size, background, and the recorded position of each icon. The desktop is a folder like any other, so it has one too, sitting at ~/Desktop/.DS_Store.
That file is the reason a layout survives a restart. It is also the reason a layout does not survive some other events. Icon positions are stored as coordinates, and coordinates only mean something relative to a screen of a known size. Change the resolution, connect or disconnect an external display, or switch the arrangement of displays in System Settings, and the coordinates no longer map onto anything sensible. macOS reflows what it can and the rest ends up wherever there is room.
Two consequences follow. First, a desktop layout that took real effort is worth treating as disposable if the machine regularly moves between a laptop screen and a docked monitor. Second, when a desktop is genuinely stuck in a broken looking state, quitting Finder after deleting ~/Desktop/.DS_Store resets the view state without touching a single file. The files are separate from the record of where their icons were drawn.
The same file also travels. Copy a folder to a USB stick or a shared drive and .DS_Store goes along with it, which is why colleagues on other systems see stray files appear in folders that came from a Mac. Nothing is wrong; that is just the view state going where the folder went.
What Show View Options actually controls
With the desktop focused, Command-J opens the view options panel. Apple describes what it is for in plain terms.
You can make icons bigger, change the spacing between icons, move icon labels to the side, or show more information (such as how many files are in a stack). Source: support.apple.com
The panel holds icon size, grid spacing, text size, label position, an item info toggle, an icon preview toggle, and the sort setting mentioned above. Two of those have costs worth knowing.
Icon preview draws a thumbnail of the actual file rather than a generic document badge. For a screenshot that is useful. For a folder of large images, video files, or layered design documents, every one of those thumbnails has to be generated and drawn each time the desktop is exposed. On a desktop holding a few hundred heavy files, switching icon preview off is the single change that makes the desktop feel responsive again.
Item info adds a line under each icon: dimensions for images, item counts for folders, duration for media. It is genuinely useful when the desktop is being used as a staging area for images, and it is clutter otherwise.
Grid spacing is the setting people never touch and should. Widening the grid gives labels room to show more of the filename before truncating, which matters more than icon size for actually finding things. Narrowing it fits more icons on screen at the price of unreadable labels.
The sort keys are not interchangeable
Sort By and Clean Up By offer the same list of keys: Name, Kind, Date Added, Date Modified, Date Created, Date Last Opened, Size, and Tags. Choosing between the three date keys is where most desktop organizing goes wrong, because they answer different questions.
Date Modified is when the file's contents last changed. Date Created is when the file came into existence. Date Added is when the file arrived in this particular folder, and it is stored by the volume rather than by the file itself.
For a desktop used as a staging area, Date Added is almost always the key you want. It answers "what landed here most recently", which is the actual question when you are deciding what to clear. Date Created answers something subtly different: a PDF exported today from a document made last year carries today's creation date, while a photo copied off a camera may carry the capture date. Date Modified is the least useful of the three on a desktop, because opening and resaving a file quietly promotes it to the top.
Sorting by Kind deserves a mention because it is the one that pairs well with a two step routine. Sort by Kind, select all the images at once, and move them in a single drag. That is faster than any per file decision, and it needs no rules or automation to set up.
What copying does to the dates you sort by
If you organize by date, the way you move files determines whether that order survives. This is testable in a few seconds and the results are consistent.
Duplicating a file with the shell command cp writes a new file whose modification date is the moment of the copy. The original date is gone from the copy. Adding the preserve flag, cp -p, keeps the modification date intact. Moving with mv keeps it as well, because on the same volume nothing is rewritten.
So a cleanup pass that copies everything off the desktop into an archive folder, then deletes the originals, will flatten every modification date to the same afternoon. A cleanup pass that moves the files leaves the history readable. When the archive is something you expect to search by date later, that difference is not cosmetic.
Date Added behaves differently again. It records arrival in the destination folder, so it is reset by any move, including a drag in Finder. That is the correct behavior for a staging desktop and the wrong behavior for a long term archive, which is another reason to switch the archive folder's sort key to Date Created or Date Modified rather than leaving it on the desktop's setting.
The icons that are not files
Not everything on the desktop lives in ~/Desktop. Hard disks, external drives, optical media, and connected servers are drawn there as well, and they are controlled from a completely separate place: Finder Settings, General tab, under the list of items to show on the desktop. Four checkboxes, four categories.
This matters when a desktop looks crowded for reasons that have nothing to do with saved files. Someone with a Time Machine drive, a mounted network share, and a couple of disk images open can have five or six icons that no amount of filing will remove. Turning those four checkboxes off does not disconnect anything. The volumes stay mounted and remain reachable from the Finder sidebar; they simply stop being drawn on the wallpaper.
The related setting one tab over, in the Advanced pane, is the folder placement control: keep folders at the top when sorting by name, with separate switches for windows and for the desktop. If a desktop mixes folders and loose files, turning that on for the desktop makes the sorted layout considerably easier to scan, because the containers group together instead of interleaving with documents by alphabet.
Turning the icons off without moving anything
There is a setting with no interface that hides every desktop icon at once while leaving all the files exactly where they are. It is a Finder preference toggled from the shell, followed by restarting Finder. The wallpaper goes clean, ~/Desktop still holds everything, and the folder opens normally from the Finder sidebar or from the Go to Folder box.
This is worth knowing because it separates two problems that get treated as one. A desktop can be visually noisy, and a desktop can be full of files that need dealing with. Hiding the icons solves the first completely and the second not at all. For a machine used in screen sharing or recording, that is exactly the right trade. For a machine where the desktop is the actual inbox, hiding the icons removes the only reminder that the inbox exists.
The honest version of the choice is that the desktop is a poor inbox for a different reason: it is the one folder whose contents you cannot search, filter, or open in a second pane next to something else. A file manager window gives all three, which is why a lot of people who solve this properly end up hiding the icons and doing the actual sorting somewhere with a sidebar and a search field. A file manager with a built in terminal goes one step further, since the batch moves described above are the kind of thing that is faster typed than dragged, and the comparison of the available options is worth reading before installing anything.
What to change first
Set the desktop sort to None, run Clean Up By Kind once, and move the largest group off in a single drag. Then decide the one thing you will keep on the desktop and turn off the four volume checkboxes in Finder Settings so nothing else competes for space. If the sorting keeps needing to be redone, that is the signal to move the work into a window rather than onto the wallpaper, and Atriens exists for that case.
Frequently asked questions
Why do desktop icons rearrange themselves after using an external monitor?
Icon positions are stored as coordinates relative to a screen of a particular size. Connecting or disconnecting a display changes the available area, so the stored coordinates no longer map cleanly and macOS reflows the icons into whatever space exists. There is no setting that pins positions across resolution changes. On a machine that docks and undocks daily, a sorted layout holds up better than a hand placed one.
What is the difference between Clean Up and Sort By?
Clean Up runs once and snaps icons to the grid without changing their order, so you can still drag things afterwards. Sort By is a persistent mode that keeps icons in a chosen order and disables dragging entirely. If placing files by hand suddenly stopped working, Sort By is switched on and setting it back to None restores dragging.
Is it safe to delete the .DS_Store file on the desktop?
Yes. It stores view state such as icon positions, icon size, and the background setting, not file data. Deleting it and restarting Finder resets the desktop to default view settings, and every file remains in place. It regenerates automatically the next time the folder's view changes.
Does hiding desktop icons free up memory or speed up the Mac?
Hiding icons stops thumbnails from being generated and drawn, which is the part that can feel slow on a desktop holding large images or video. The files themselves still occupy the same disk space and are still indexed. If responsiveness is the goal and hiding everything is too drastic, turning off the icon preview option in the view options panel gets most of the benefit.