Which file cleaner is best?

I was wondering what the consensus is on programs that clean residual files off your hard drive. . . . which one is considered best, and the most adequate and what does everyone use most?

I.e. I’ve got Octopi cache cleaner, sweeper, bleachbit and stacer on board my system. They all seem to show to various levels of what they clean up as far as files. What’s the general consensus here on this?

Food for thought?

Rich :slight_smile:

Personally I never use (and never used) file cleaners for /home. This is Linux, more files don’t make the system slower.

Plus: Distrohopping is the best file cleaner anyway. :wink:

5 Likes

Stacer is probably the most commonly used.

My personal consensus is that such tools are basically a waste of time and have a greater chance of breaking something than actually making the system better in some way.

12 Likes

Because they have different definitions of whats considered junk :slight_smile: See what exactly they are deleting. You may end up losing some half important file.

I manually delete files from my /home once in a while.

Edit :
I use baobab to see which files are taking up space
https://archlinux.org/packages/extra/x86_64/baobab/

5 Likes

If one does not need a GUI there also ncdu:
https://archlinux.org/packages/community/x86_64/ncdu/
Quite handy as you can delete folders rightaway from it.

3 Likes

I use bleachbit for application level file cleaning … best to avoid any form of system file cleaning with a tool like this (or stacer) though.

Use a tool like qDirStat of Filelight to analyze disk space usage.

Use paccache to maintain your pacman cache, which can get big if you don’t manage it.

Also use sudo journalctl --vacuum-size=[XX]M to trim your journal logs, which can grow to many GBs if left alone.

You can also limit their size in /etc/systemd/journald.conf, saves having to periodically vacuum.

...
SystemMaxUse=50M
...
RuntimeMaxUse=50M
...
4 Likes

i love to use one of the most simple and in the same way, the most advanced tool for it, you can imagine: rm

:smiling_face_with_three_hearts: :sunglasses:

7 Likes

All these years I have used bleacbit without problems in many different distros. To me much more dangerous procedure has been removing orphans. Some time ago when I wasn’t paying enough attention what packages this command: pacman -Qtdq | pacman -Rns - was actually doing I lost vlc… :sweat_smile:
Of course I could reinstall it later, but it was a good reminder you should always be careful when using such commands.

It is best to not use a file cleaner. Delete files you don’t want manually, this is much safer and less prone to errors.

5 Likes

I use this to clean my system :
pacman -Sc or -Scc, same for yay
trash-empty
sudo du -sh ~/.cache/
rm -rf ~/.cache/*
rm -rf ~/{.bundle,.cargo,.cmake,.dotnet,.electron,.electron-gyp,.gem,.gradle,.lazarus,.node-gyp,.npm,.nuget,.nvm,.racket,.rustup,.stack,.yarn} || true
sudo rm -rf ~/go || true
rm -rf ~/.cache/{electron,electron-builder,go-build,node-gyp,pip,yarn} || true

Also rebuild-detector with checkrebuild command

So you check how big it is and then delete it anyway? :grin:

3 Likes

Uhm, i guess is the same result, no need to run both?

2 Likes

There is no need for sudo here. It’s always a good idea to be extremely cautious when using sudo and minimise its usage whenever possible. The whole point of sudo is to limit the use of the root account to only the tasks that require root privileges to be completed.

So if something works without sudo, it’s bad practice to use sudo, because it goes against its purpose.

6 Likes

I second this. Every once in a long while I fire up baobab and check to see if there’s something under the rug somewhere. I check for folders taking up unusually large space and then go ahead and manually remove the files that I no longer need. In fact you can delete a directory directly from Baobab itself, which makes it even more convenient to use.

3 Likes

There’s several different visual disk usage analyzers if all you want to do is see what’s taking up space
https://www.ubuntupit.com/best-disk-analyzer-tools-for-linux-system/

As for the other tools they’re just graphical interfaces for a file search that you could do with du or find. So, depending what they’re programmed to look for they’ll show different things. The key is reading what they’ve found and deciding whether you need those files or not. Then, use the one that finds more files you want to delete. But you might be better off just writing your own script to find and rm what you want, like badplugin did above. Just know what’s being deleted or you’re better off leaving it on your drive.

I like Filelight because of its pretty visualisation and exploratory workflow, but the good old du is also very useful, because it’s just so quick and easy to use.

Thanks, I didn’t know that so far and I looked at it and it’s an encouraging initiative for a first blick. So far I have used and continue to use Bleachbit. When I installed something from the AUR and the compilation process was interrupted for some reason, Bleachbit often came in handy to remove the debris

1 Like

Baobab is a pretty useful application, I’ve been using it for a long time since I used XFCE.

1 Like

Some comments or notes besides each of these commands would be helpful to noob like me :slight_smile:

1 Like