Alt Text
A screenshot of a file manager preview window for my ~/.cache folder, which takes up 164.3 GiB and has 246,049 files and 15,126 folders. The folder was first created about 1.75 years ago with my system
You don’t have to clean your ~/.cache every now and then. You have to figure out which program eats so much space there, ensure that it is not misconfigured and file a bugreport.
So OP’s headline should be saying instead: Reminder to CHECK your ~/.cache folder every now and then
Cache exists for a reason, that sounds like itd break programs, a safer method is probably having it be a ramdisk
Check? Why?
% du -sh ~/.cache
1,6G /home/bizdelnick/.cache
I don’t remember if I ever cleaned it up. Probably a couple years ago when I moved my old HDD to new PC with freshly installed OS. It does not grow accidentally. Only in some very rare cases. As well as some other dirs under ~
and var
. If it is a critical system, set up monitoring of free filesystem space. If not, you will notice if it becomes full (I can’t remember when this happened to me last time, maybe ~15 years ago when some log file started to grow because of endless error messages).
Because some users experienced accidential grows like OP had 160 Gbyte. So general advice for linux users can be stated as: Check your ~/.cache every now and then
Critical systems/servers shall better be monitored as you suggest.
That’s not very cache money of you
I did this and now my games have no icons in lutris, some of my gnome settings got reset and my proton email bridge stopped working
Cannot this be caused by deleting the folder and not just everything inside?
Even better: mount ~/.cache as ramfs. It will also speed up some apps significantly.
I always felt that there should be some user directory like /tmp/
which will be wiped regularly.
Because of excessive RAM I symlink ~/.cache
to /tmp
. Additionally installing zramswap
helps for this scenario.
Benefits are faster access, automatc purging between reboots and no wear to the NMVe drive.
Yes, this is a single user scenario.
This seems like a filename conflict waiting to happen. Why not just mount a tmpfs there?
Like I said it’s a cheap solution for a single user system. Ofc tmpfs would be better but has to be done for every user again
You: It’s a single user system
Also you: Tmpfs would have to be done for every user
And a /tmp/ symlink would have to be created for every user too, so I don’t get your point
Tmpfs is just as easy as making a symlink, but without the filename conflicts between files in ~/.config/ and /tmp/. You just need to add a line to /etc/fstab