Re: Thousands of cache files clutter ...

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/html)
+ (text/plain)
Delete this message
Reply to this message
Author: Arun Khan via PLUG-discuss
Date:  
To: Main PLUG discussion list
CC: Arun Khan
Subject: Re: Thousands of cache files clutter ...
On Sun, Aug 4, 2024 at 6:25 PM joe--- via PLUG-discuss <
> wrote:

> How crucial are the thousands of cache
> files cluttering up our computers?
>


To my knowledge, they are not crucial.
I delete them before a full back of my $HOME and have not seen any
application breakage.

I have my shell script here for you to modify to fit your needs.

HTH,
--
Arun Khan

<begin bash script>

#!/bin/bash

#
# Script to clean up files in [Cc]ache [Tt]rash in user's home directories
#

[ ! -d $HOME ] && echo "There is no HOME dir for $USER" && return 1

TMPFILE=/tmp/cache_n_trash_dirs$$

# define directory strings here
dir_string1="\( -type d -iname '*cache*' \)"
dir_string2="\( -type d -iname '*trash*' \)"
dir_string3="\( -type d -iname '.local' \)"

find $HOME \( -type d -iname '*cache*' \) -o \( -type d -iname '*trash*' \)
| \

sed -e 's/^/"/' -e 's/$/\/"/' | sed -e 's/^/rm -fr /' > $TMPFILE

# add thumbnails directory to the list
echo "rm -fr $HOME/.thumbnails/* " >> $TMPFILE

cat << EOF

Temporary shell script file written in $TMPFILE;
Please execute the following line:

bash $TMPFILE

EOF

<begin bash script>
---------------------------------------------------
PLUG-discuss mailing list:
To subscribe, unsubscribe, or to change your mail settings:
https://lists.phxlinux.org/mailman/listinfo/plug-discuss