sunred,
@sunred@discuss.tchncs.de avatar

du -sh ~/.cache/* | sort -h

therealjcdenton,
noroute,

You can also setup a cron job to periodically clean oldest files for you.

Example: @weekly find ~/.cache -type f -mtime +7 -delete

This will delete everything older than 7 days inside your cache folder.

twei,

I guess you could also Mount a tmpfs to that directory

lntl, (edited )

$ crontab -e

      • */2 * rm -rf /home/lntl/.cache
vox, (edited )
@vox@sopuli.xyz avatar

seems like a bug in one of rhe programs you’re using.
modt software automatically manages it’s cache…
are you using build caching tools such as Mozilla sccache? These tend to create 20gb+ cache directories, especially if used with debug builds

HiddenLayer5, (edited )
@HiddenLayer5@lemmy.ml avatar

I just map both the user cache and the /tmp directory to a RAM drive. I allocated 4 GB but in practice it never gets even close to that much, and Linux seems to not be reserving the entire 4 GB at boot so I would assume how much RAM is used depends on how much is actually in your cache.

It also defers cache and tempfile related problems to turning it off and on again.

Pantherina,

Your Distro should normally do that for you.

Advising for this means people will delete random cache and download stuff always.

Are multiple files in there? If yes you could add a script that only deletes files of certain age.

Takios,

I’m not aware of any distro that automatically clears a user’s .cache in their home directories. Maybe you’re thinking of /var/cache?

redd,
@redd@discuss.tchncs.de avatar

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

Pantherina,

No.

Zangoose,
@Zangoose@lemmy.world avatar

Maybe not while it’s running, but .cache is intended to be temporary files only so expecting files to permanently be there should be treated as a bug

ArcaneSlime, (edited )

…yeah let me go check that…

13,574 totaling 1.7gb, not too bad. Hey OP how do you get to this view? It looks like we both use nautilus but when I select “properties” on the .cache folder it looks different.

Zangoose,
@Zangoose@lemmy.world avatar

I use thunar (with ePapirus-Dark icons which is probably what makes it look like nautilus), I liked nautilus when I used it but thunar has a bit more functionality that I like

ArcaneSlime,

Ah thanks!

kaesaecracker,

the screenshot does not look like nautilus, maybe xfce?

Shape4985,
@Shape4985@lemmy.ml avatar

Bleachbit is good for clearing up some space

OsrsNeedsF2P,

And deleting emails

zingo,

Even Hillery knows that one.

Come on!

/s

possiblylinux127,

Check which folder is the biggest. I am going to go on a lim and say it probably is being caused by file roller

Zangoose,
@Zangoose@lemmy.world avatar

It’s yay, which took up ~160 GiB. It was storing previous versions of AUR binaries which I guess added up over time. I posted a screenshot of ncdu outputs for a more detailed breakdown in one of the other reply threads

archy,

<span style="color:#323232;">yay -Sc(c)
</span>

Is probably a better command in this instance

Lionel,

This is why Linux sucks!

xor,

That’s nice

PixxlMan,

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

archy,

Like the kernel itself sucks or a specific distro sucks?

Lionel,

ALL OF IT

zingo,

Shotgun approach I see.

TheWoozy,

Don’t feed the trolls.

sebsch,

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

redd,
@redd@discuss.tchncs.de avatar

I always felt that there should be some user directory like /tmp/ which will be wiped regularly.

glibg10b,

/run/ contains such a directory

Krause, (edited )
@Krause@lemmygrad.ml avatar

/tmp and /var/tmp are writable to regular users on most distributions

majestic,

No way. If i clean up my .cache directory my precious cached with sccache rust deps would be very upset. >:[

bizdelnick, (edited )

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,
@redd@discuss.tchncs.de avatar

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

cupcakezealot,
@cupcakezealot@lemmy.blahaj.zone avatar

just symlink ~/.cache to /dev/null

Amends1782,

Lmao some malicious ass advise here

KSPAtlas,
@KSPAtlas@sopuli.xyz avatar

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

qaz,
bizdelnick,

Check? Why?


<span style="color:#323232;">% du -sh ~/.cache
</span><span style="color:#323232;">1,6G    /home/bizdelnick/.cache
</span>

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, (edited )
@redd@discuss.tchncs.de avatar

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,

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,
@redd@discuss.tchncs.de avatar

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.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • linux@lemmy.ml
  • localhost
  • All magazines
  • Loading…
    Loading the web debug toolbar…
    Attempt #