Live data from Hacker News

Show HN: Clean Your Mac with a Script

github.com

1–10 of 21 posts

Re: Show HN: Clean Your Mac with a Script

#3
post #2

Yep, df gonna run this rando script with such a detailed and inspiring README... (in all seriousness folks, if you're gonna show HN, spend some time on your README, docs, etc).

The README should be better but the script is like 100 lines or so.

The main issue I'm finding is that `find` seems extremely slow at deleting things.

Re: Show HN: Clean Your Mac with a Script

#5
post #3
post #2

Yep, df gonna run this rando script with such a detailed and inspiring README... (in all seriousness folks, if you're gonna show HN, spend some time on your README, docs, etc).

The README should be better but the script is like 100 lines or so. The main issue I'm finding is that `find` seems extremely slow at deleting things.

And half of that is parsing the options and processing the dry run...

The script is clean and straightforward.

Re: Show HN: Clean Your Mac with a Script

#7
1) Deleting individual files from ~/Library/Caches based only on their mtime is not safe - especially since some files (like files extracted from archives or downloaded over HTTP) may be stored with an mtime matching the source data. At a minimum, you really need to base this on the last access time; even then, I would be hesitant to delete individual files from an application's cache while leaving others.

2) /tmp and /var/tmp are cleared on reboot. Clearing them manually is probably not worth the hassle.

3) A week is way too short as a default for DAYS_TO_KEEP. A more appropriate value might be on the order of 30 - 90 days.

4) brew doctor is purely a diagnostic tool; it doesn't perform any maintenance operations. It doesn't belong in this script.

Re: Show HN: Clean Your Mac with a Script

#8
post #4

Isn't zsh the current #!/bin/sh on MacOS? Why is this written for bash, which isn't getting recent changes?

Compatibility with older devices that aren't eligible for recent OS updates, I would assume?

Or, if the person is like me, they're more comfortable in Bash after years of it being the default. Hacking around in a less-familiar shell seems like a bad idea if it's optional when deleting data, regardless of what's currently the default. (I realize that zsh can execute commands with Bash syntax, that's not my point.)

Re: Show HN: Clean Your Mac with a Script

#10
I'm sure this script is wonderful, but it's not a replacement for the apparent target of the author's disparagement, created by the legit folks at MacPaw (established 2008). A good place to start is the free Unarchiver, which can extract anything you can throw at it. https://macpaw.com/the-unarchiver
Post reply on HN