I don't need to clean up my desktop and downloads folders in macOS (2021)
stefanjudis.com
stefanjudis.com
My strategy is simple, I fill with my computer with crap until I decide I want a fresh start.
Then I back up these folders to a backup/year/month folder and never open them again.
But if I ever need that meme from 2013, maybe I'll find it.
At first I just moved everything into a folder named "old" that sat in the same place, and eventually probably wound up having 20 or 30 recursive folders all named "old".
It wasn't until after probably a decade of that I had the big-brain moment to actually bother labeling them by month+year and put them all at the same level in an explicit backup directory...
Ironically enough I have a folder on my desktop called "Sorted" that I just drag things into when I haven't used them in a while. Gotta love the search function, else I'd never find anything in the rare case that I do need it.
Comes in handy sometimes however, like having the installers for every major version, patch and RC of an indie game going back a decade, or old editions of a minecraft or skyrim mod that the author may have pulled offline in some hissy fit or another.
Any info I need to retrieve can be found by searching for filenames or the various file metadata.
It's surprisingly easy to reliably remember that I would have put something in the "needed infrequently when I'm willing to spend a few minutes looking for" drawer.
I used to do it once a year, but I'm down to once every other year now. Backup folders get the machine name & year, and put on dropbox/drive/nas/other.
Entire machine is wiped, OS is installed, everything feels so fresh and sparkly. It's a bit like going to the dentist - not exactly fun, but you feel very clean for a bit afterwards.
Really helps also wipe out all the other accumulating cruft you just don't have the time or energy to go delete.
I'm not just wiping root and leaving home/mail/etc alone. I'm wiping and re-partitioning the local drive.
The partition layout on macOs is fairly complex - on those machines it would be comparable to "Erase all contents and settings" option, but also with a refresh of the immutable OS to the latest released revision (Not always the case on macOS, depending on your recovery drive configuration).
---
That said, I don't buy Apple products for personal use - they're far too hostile to their users for me to give them money, and I was always a "function over form" kinda guy in the first place, which is not Apple's market. Apple is the chauffeured car of the computer world... Smooth, Expensive, Hands-Off. I don't always want to drive manual, but I'm not willing to give up the steering wheel... so windows, linux, and bsd for me. Although lately, less and less Windows.
It's a time machine for your feelings.
Now, I have a much simpler approach: whenever I touch a file, I'll put it into the right location. The downloads folder is mostly empty.
Same principle in real life. Things have have their designated place and they go back there after use.
Clutter simply doesn’t exist in my life.
Abusing /tmp sounds fun as well tho.
defaults write com.apple.finder CreateDesktop -bool false && killall FinderI have Desktop added as one of those fan-out folders in the MacOS Dock so it's really easy to drag-n-drop the newest screenshot to GitLab etc.
Source here in case it's useful for anyone: https://github.com/f-f/home/blob/ee0ae5dd201ac6e8ffa60fff71b...
I'm not sure I get the advantage of putting things into a tmp directory. If I have to move things out of there to avoid them being deleted automatically, that seems like about the same amount of work as just archiving important downloads and then deleting everything in ~/Downloads once in a while. And safer too. By that logic, you might as well just save your downloads in the Trash.
The key to happiness is to accept the mixture, also accept that you sometimes rename and reorganize stuff, that that sometimes makes it better and sometimes makes it worse, and that sometimes thinking about all of this is just procrastination, but sometimes it's not!
I'm too lazy to move things out of ~/Downloads, so I've just started using the folder as my default working directory and struggle to clean it out every quarter or so. /tmp (or probably ~/Library/Caches/TemporaryItems for my account only) being cleaned out on every reboot would force me to be more intentional.
$ ls -ld ~/{Desktop,Documents,Downloads}
lrwxr-xr-x 1 abathur staff 24 Apr 19 2020 /Users/abathur/Desktop -> /Users/abathur/Downloads
lrwxr-xr-x 1 abathur staff 24 Apr 19 2020 /Users/abathur/Documents -> /Users/abathur/Downloads
drwx------+ 233 abathur staff 7456 May 29 13:56 /Users/abathur/DownloadsI copy anything useful to a NAS and then delete the rest.
@reboot rm -rf /Users/me/Downloads/*
Throwing away _all_ downloads / items on the desktop is not the hard part. The hard part is deciding if there’s any wheat in with the chaff.
Nowadays, storage is cheaper (though of course not free), so whenever i download BIG files, i review to see if said file is worth saving...If it is, then i promptly move it intop a relevant directory. If not worth saving, then i delete it. As an example, I do this alot with ISO files for Linux distros. Sometimes i download it, copy it to a usb thumb drive, try out the linux distro, and then delete it. Now, if downloaded BIG files so often, then i guess this method won't scale...but for me, its a solved issue.
cmd-shit-5, then options.
More details: https://www.tomsguide.com/how-to/how-to-change-the-screensho...
*/10 * * * * /usr/bin/find ~/tmp/hour/ -mindepth 1 -mmin +60 -cmin +60 -delete
0 * * * * /usr/bin/find ~/tmp/day/ -mindepth 1 -mmin +1440 -cmin +1440 -delete
# etc
Files in ~/Downloads/ are deleted in the same way, after 2 hours.
If I download something that I want to keep "forever", I move it to where it belongs. Anything that is not "forever" goes into one of the ~/tmp/ subdirs (with a useful filename so I can trivially find it when I need it).
You get into the habit of moving things out of ~/Downloads/ very quickly, and it's not very painful: downloaded things can almost always be re-downloaded if you forgot to move them.I used to have another (crude) cronjob to warn me before deleting files:
0 21 * * * (/usr/bin/find /Users/me/tmp/week/ -mindepth 1 -mtime +5 -ctime +5; /usr/bin/find /Users/me/tmp/month/ -mindepth 1 -mtime +28 -ctime +28; /usr/bin/find /Users/me/tmp/6months/ -mindepth 1 -mtime +183 -ctime +183) | /usr/bin/sed 's/^.Users.me.tmp.//g' | /usr/bin/mail -E -s "will delete some ~/tmp files soon" me@domain
... but I found it unnecessary. In practice, I just take some margin in deciding where to put things. If I think I'll need it for max a week, I'll put it in tmp/month to be on the safe side, etc. And worst case, I can just retrieve it from my backups.I can't recommend a system like this enough. It feels like "inbox zero" for your filesystem; very liberating.
daily_clean_tmps_dirs="/tmp"
from /etc/defaults/periodic.conf to /etc/periodic.conf — create the latter if it doesn't exist, making sure it's only writable by root — and adding additional space-separated directory paths after /tmp (for a path containing a space or any other character that may be special to the shell, create a symlink to it with a clean path and add the symlink's path).I have no real problem with the 7 day life span of files there, but since I actually do put quite a bit of "temporary context" into /tmp, it's a bit annoying to have it wiped out on restart.
Now, yes, of course, I can simply create a new folder, create my own 7 day sweeper and be done with it.
The simple nut is that I've been using /tmp for 30 years (like vi, every unix machine has a /tmp), and it's a bit hardwired into my muscle memory. And since the machine is supposed to do my bidding, not the other way around, it would be nice to be able to configure it to not do this.
But, hardly a crisis, I'm coping.
I might be missing something but these are the key suspects (I generally prefer this to be wiped, using tmpfs)
Not sure about anything else *nix
My downloads folder is effectively categorized as
AW - artwork, could be pics, videos that I create or download, further into monthly phone backup, jellyfin etc
SW - software, contains anything I've downloaded, specific folders for each caterory like 3D printing, setup files, repo code zips/model weights etc
PDFs - as the name implies PDFs only, mostly arxiv papers grouped by month-year folders & backed off monthly to phone & NAS
-----
Has worked like a charm for me for a while & very easy to take backups of my machine since everything essential is present within the Download sub-folders
It's not hard to stay organized. Downloads and desktop folders should be for temporary storage, and never so long that you have to scroll to see what's in them. That's what subdirectories are for.
Gives me sort of a drip feed of items to either delete or move to a proper folder. I also place the 'Review' folder in the Dock, so it is usually empty, but every now and then a file pops up in the preview, so I can move it somewhere.
I think /tmp/ is auto-mapped to /private/tmp though, which is also user-specific.
Edit: after a bit of web searching, I'm not finding any suggestion that /private is somehow mapped per-user. Is this actually true?