Hidden files in OS X?

The partition that my OS 10.2 is installed on seems to be filling up all of a sudden. In the last couple of days it’s filled up by about 600 MB, and it’s nearly full. I can’t seem to find anything that would account for it. Does OS X create any hidden temp files that might account for it? Or do any common apps do the same thing, storing their temps on the startup disk? Thanks in advance.

There is a <Temporary Items> folder at the root level of a MacOS X disk. I find this is not used much, but it’s worth a look.

More likely, there is some application which is using the disk as as cache. Applications are supposed to put their cache in ~/Library/Caches/. You should look at this folder and see if anything is unusually large. If there nothing usual there, you must have some application which is putting things in a non-standard location. You’ll just have to poke around until you find it.

It might be something with a memory leak eating up virtual disk space.

You can bring up Process Viewer (in applications->utilities), which will give a list of running processes. If you switch to the “Statistics” tab on the bottom of the screen and step through the processes, it will show you how much virtual and real memory each process is using.

I found that if I used the finder’s preview to view images in my iPhoto directory it could sometimes get very large. Usually it would free up that memory after a while, but if it was getting really piggy and using up all the available disk space then I’d do a force quit on it (select the process, then Process menu -> Quit Process, click force quit). It’s safe to do this on the finder, as it will automatically restart in a second, but be careful trying this on any process that you don’t recognize.

Bingo! Explorer had a whopping 650 MB cache file, so I deleted it, and all is right with the world. Thanks.

This is why us *nix freaks of other stripes (Linux, BSDs, etc.) tend to put our /tmp directory on a seperate partition. Not on a different disk, usually, but on a partition it can fill up without filling up our entire root filesystem.

If you don’t want to do that, create a cron job to periodically delete the contents of the directory Explorer seems to like filling with crap. (Better yet, don’t use Explorer. Use Mozilla. ;)) Ask a more advanced MacOS X user if you don’t know how. (I run Linux, and I don’t know just how much Apple’s changed things.)

Anyway, there really are hidden files in some directories, mostly in your home directory, created by programs to hold things like configuration details and preferences. They’re hidden so you don’t need to see them every time you list the contents of the directory. To see them, run ls -a on the command line. The ones with names that begin with a dot (like `.bashrc’) are the hidden ones.

In a related vein, MacOS X has a number of daily, weekly, and monthly tasks that it runs in the background to get rid of temporary files, clean up logs, and that sort of stuff. Unfortunately, by default, those run at 3:00am, and if your Mac is off at the time, they won’t get run.

The solution is to run MacJanitor (Versiontracker.com is a good source). Just click the tasks you want it to run, and it’ll do those late-night cleanup tasks immediately. I run it every few weeks just to keep things tidy.

And IIRC, most temporary caches will get deleted by MacOS X if you simply log out (no restart needed).

Linux has responded to this same problem by replacing the traditional cron with the newer anacron on modern distros. I don’t know how precisely it works, but you can certainly look it up.