Can I delete the logs in the /private/tmp folder?

Seems like there are around 5,000 wifi logs, each 2MB each, totaling nearly 10GB on my disk in /private/tmp. Can I delete these logs, or will macOS automatically delete them itself? I tried making a file using the mkfile command until I had about 2GB of disk space left, but nothing was automatically cleared.


Solution 1:

In the standard configuration, launchd will run the "periodic-daily" script once a day with a low priority. The periodic-daily script will run the /etc/periodic/daily/110.clean-tmps script, which in turn removes the files in /tmp (which is the same as /private/tmp) that haven't been accessed for 3 days.

So normally these log files will be deleted every 3 days, unless ofcourse something is still writing to them - or you yourself are opening them all the time to check them.

You do not specify the file name of the files you're worrying about. Normally it should be safe to just delete log files in /private/tmp/.

Solution 2:

Follow this info to get your scripts to run (important if you don't leave your Mac on all the time).

http://www.thexlab.com/faqs/maintscripts.html