Firefox 143 - Safe to purge ALL under ~/.cache/mozilla/*/*?

Everywhere I check, it says to use the browser built-in functions to clear cache and cookies.

But … even after I do that, there always remain MANY files under that directory structure !!!

###	Before purge:

# du -sh /home/ericthered/.cache/mozilla/*/*
39M	/home/ericthered/.cache/mozilla/firefox/OasisMega1.FirefoxProfile_DEFAULT
25M	/home/ericthered/.cache/mozilla/firefox/OasisMega1.FirefoxProfile_DEFUNCT
43M	/home/ericthered/.cache/mozilla/firefox/OasisMega1.FirefoxProfile.Geogebra

###	After purge:

# du -sh /home/ericthered/.cache/mozilla/*/*
30M	/home/ericthered/.cache/mozilla/firefox/OasisMega1.FirefoxProfile_DEFAULT
25M	/home/ericthered/.cache/mozilla/firefox/OasisMega1.FirefoxProfile_DEFUNCT
43M	/home/ericthered/.cache/mozilla/firefox/OasisMega1.FirefoxProfile.Geogebra

I want a full purge before backups, but that shows

  • only a minimal reduction in the active browser profile, and
  • only a reduction for the active browser profile

Does anyone know of any reasons why I should NOT purge using the form

rm -rf /home/ericthered/.cache/mozilla/*/*/*

OR …

Can I just purge all non-directory files, namely

find ${MyHoMe}/.cache/mozilla/*/* \( ! -type d \) -print |
      xargs  -I '{}'   rm -fv '{}'

My big concern are files that are of the form

  • *-track-digest256.vlpset
  • *.json
  • *-digest256.sbstore
  • */settings/main/*
  • */personality-provider/*

:thinking:



Whatever I come up with, I want to incorporate into the following pre-backup purging script:

#!/bin/sh

echo "\n PURGING ... all possible non-critical transient files - USER-specific ...\n"

##################################################################
###
###	GROUP I - Purgeable found under ${HOME} directory
###


###	LOCATION: /home/ericthered/.cache/tracker3
#tracker3 status			###	Report on data collected
echo "\t PURGING:  /home/ericthered/.cache/tracker3 ..."
tracker3 reset -s -r		###	purge contents


###	LOCATION: /home/ericthered/.cache/pip
#pip cache info
echo "\t PURGING:  /home/ericthered/.cache/pip ..."
pip cache purge


###	CREATOR:  File Roller, a.k.a. Archive Manager
echo "\t PURGING:  /home/ericthered/.cache/.fr-*?????? ..."
rm -rf /home/ericthered/.cache/.fr-*??????	# ex. fr-E1X9Z4


###	CREATOR:  Caja/FileManager
# /home/ericthered/.cache/thumbnails/large/
# /home/ericthered/.cache/thumbnails/normal/
echo "\t PURGING:  /home/ericthered/.cache/thumbnails/fail/*/* ..."
rm -f /home/ericthered/.cache/thumbnails/fail/*/*


###	CREATOR:  Calibre eBook Library
echo "\t PURGING:  /home/ericthered/.cache/calibre/ ...*"
rm -rf /home/ericthered/.cache/calibre/*


###	CREATOR:  Epiphany Browser
echo "\t PURGING:  /home/ericthered/.cache/epiphany/* ..."
rm -rf /home/ericthered/.cache/epiphany/*


###	CREATOR:  Liferea Feed Reader
echo "\t PURGING:  /home/ericthered/.cache/liferea/* ..."
rm -rf /home/ericthered/.cache/liferea/*


###	CREATOR:  node.js during module compilations
echo "\t PURGING:  /home/ericthered/.cache/node-gyp/* ..."
rm -rf /home/ericthered/.cache/node-gyp/*


###	CREATOR:  Firefox
#echo "\t PURGING:  /home/ericthered/.cache/mozilla/* ..."
#rm -rf /home/ericthered/.cache/mozilla/*


##################################################################
###
###	GROUP II - Purgeable found elsewhere on host
###

echo "\n PURGING ... all possible non-critical transient files - OS-level ...\n"
1 Like

[1] Does purging files under

/var/cache/*

break any of the related applications which are listed there?


[2] I have 4.1 GB under

/var/lib/snapd/cache/

Can those be purged without breaking any of the OS-core elements?

1 Like