this post was submitted on 03 Dec 2023
8 points (90.0% liked)

Linux

50029 readers
1601 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

Alt TextA 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

all 26 comments
sorted by: hot top controversial new old
[–] ryannathans@aussie.zone 2 points 1 year ago (5 children)

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

[–] lloram239@feddit.de 6 points 1 year ago

Time to write some bug reports. ~/.cache is supposed to be disposable.

[–] sebsch@discuss.tchncs.de 4 points 1 year ago

So the apps are broken. Cache is meant to be deleted at any time

[–] Iapar@feddit.de 1 points 1 year ago

You shouldn't have done that Dave.

For some reason devs can't wrap their head around cache being temporary.

[–] stepanzak@iusearchlinux.fyi 0 points 1 year ago (2 children)

Cannot this be caused by deleting the folder and not just everything inside?

[–] glibg10b@lemmy.ml 1 points 1 year ago

It's likely. mkdir fails to create a subdirectory such as ~/.cache/mozilla/ if ~/.cache/ doesn't exist, unless -p is explicitly passed to mkdir

Of course, not everything is a shell script, but I imagine the directory creation functions in many languages work similarly

[–] ryannathans@aussie.zone 1 points 1 year ago

The contents were deleted

[–] bizdelnick@lemmy.ml 2 points 1 year ago* (last edited 1 year ago) (1 children)

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.

[–] redd@discuss.tchncs.de 1 points 1 year ago (2 children)

So OP's headline should be saying instead: Reminder to CHECK your ~/.cache folder every now and then

[–] cupcakezealot@lemmy.blahaj.zone 2 points 1 year ago (1 children)

just symlink ~/.cache to /dev/null

[–] KSPAtlas@sopuli.xyz -2 points 1 year ago (1 children)

Cache exists for a reason, that sounds like itd break programs, a safer method is probably having it be a ramdisk

[–] bizdelnick@lemmy.ml 0 points 1 year ago (1 children)

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).

[–] redd@discuss.tchncs.de 0 points 1 year ago* (last edited 1 year ago) (1 children)

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.

[–] bizdelnick@lemmy.ml 2 points 1 year ago (1 children)

Some users experienced accidential growth of /var/log. Some users experienced accidential growth of /var/cache. Some users experienced accidential growth of /var/lib. Some users experienced accidential growth of ~/.xsession-errors. Shall I continue?

Does every user need to begin his day checking all that places? No, he does not. It is waste of time. Such situations are extremely rare. If you are paranoid, check df to see if you have enough free space, and only if it unpredictably shrinked begin to ivestigate which directory has grown.

[–] redd@discuss.tchncs.de 1 points 1 year ago

I don't get your point. Why should somebody do this every day?

As the experience from other users in this thread, it seems not extremely rare to have an overgrown ~/.cache/ folder. So checking it from time to time is a good advice. If we all do this for a time, and create bug tickets for software which is not cleaning up. Then this problem will hopefully go away with future software releases.

[–] sebsch@discuss.tchncs.de 1 points 1 year ago

Even better: mount ~/.cache as ramfs. It will also speed up some apps significantly.

[–] nick@midwest.social 1 points 1 year ago

That’s not very cache money of you

[–] redd@discuss.tchncs.de 0 points 1 year ago (1 children)

Is it safe to clear ~/.cache/mozilla/ while Firefox is running?

[–] Lionel@endlesstalk.org -2 points 1 year ago (1 children)
[–] PixxlMan@lemmy.world 1 points 1 year ago

Windows famously never generates any garbage files. It's so reliable all servers run windows. Right?

[–] Jinn@sh.itjust.works -2 points 1 year ago (2 children)

This is one of those things that makes me shake my head about Linux. It's these small dumb problems that make Linux inaccessible to the common person.

[–] TheWoozy@lemmy.world 1 points 1 year ago

I've been running Linux as my primary OS since the late 90s and have never run into this problem.