LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-10-2024, 02:47 PM   #1
rfoLqOrg
Member
 
Registered: Nov 2023
Posts: 31

Rep: Reputation: 0
Linux-equivalent to CCleaner: Cleaning up disk space


I know of many (but not all) these locations where files can be found that can/should be deleted to clear disk space. On Windows I use CCleaner, which does a decent job. Windows also has a built-in cleaner facility in Disk Management.

1) Is there a safe Linux-equivalent to CCleaner or that Disk Management tool?
2) Alternatively, I want to write a script that goes through the usual
suspect locations for clean-up. Someone has a script like that?
3) To that end, what are the usual suspect locations to concentrate on?
 
Old 02-10-2024, 02:51 PM   #2
uteck
Senior Member
 
Registered: Oct 2003
Location: Elgin,IL,USA
Distribution: Ubuntu based stuff for the most part
Posts: 1,173

Rep: Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501
I have not used CCleaner, but some of these tools might help you:
apt search diskspace
Sorting... Done
Full Text Search... Done
filelight/jammy,jammy 4:22.04.3-0ubuntu1~ubuntu22.04~ppa1 amd64
show where your diskspace is being used

gdmap/jammy,jammy,jammy,jammy 0.8.1-5build1 amd64
Tool to visualize diskspace

libfilesys-diskspace-perl/jammy,jammy,jammy,jammy,jammy,jammy,jammy,jammy 0.05-16+nmu2.1 all
fetch filesystem size and usage information from Perl
 
Old 02-10-2024, 02:54 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,719

Rep: Reputation: 5911Reputation: 5911Reputation: 5911Reputation: 5911Reputation: 5911Reputation: 5911Reputation: 5911Reputation: 5911Reputation: 5911Reputation: 5911Reputation: 5911
Look at fslint or bleachbit.
 
Old 02-10-2024, 11:06 PM   #4
leclerc78
Member
 
Registered: Dec 2020
Posts: 169

Rep: Reputation: Disabled
https://easylinuxtipsproject.blogspo...lean-mint.html

The examples are for Mint, but should be similar for other Debian based.
 
Old 02-11-2024, 03:50 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,130

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
So the short answer is "no, there is no such command". But you can write a script to do (most of) what you want.

As alluded above, different distros will require accommodating - but that could be done in the one script with some work.
 
Old 02-15-2024, 03:30 PM   #6
rfoLqOrg
Member
 
Registered: Nov 2023
Posts: 31

Original Poster
Rep: Reputation: 0
"But you can write a script to do (most of) what you want."

I know, and this is why I also asked for the directories and files I can concentrate on for safe deletion.
So, what are they?
 
Old 02-15-2024, 04:11 PM   #7
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,605

Rep: Reputation: 2548Reputation: 2548Reputation: 2548Reputation: 2548Reputation: 2548Reputation: 2548Reputation: 2548Reputation: 2548Reputation: 2548Reputation: 2548Reputation: 2548
Quote:
Originally Posted by rfoLqOrg View Post
So, what are they?
We can't tell you what files you don't want.

Some people like to clear their package manager cache regularly, others might want to prune browser downloads, others might want to limit how long logs are kept for, and so on.

Best to use Filelight (or similar) to identify large pockets of data, then ask "what is this? do I want it?".

You can read the Filesystem Hierarchy Standard to get an approximate idea of what various directories might contain - but it's not authoritative / strictly adhered - it's more of an approximate guide than a standard.

Ultimately, if you're low on disk space, it may be simpler to buy a bigger disk, rather than waste time trying to clear every bit of unwanted data.


Last edited by boughtonp; 02-15-2024 at 04:33 PM.
 
Old 02-15-2024, 06:18 PM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
As above, what 'you' want to keep or not, is specific to 'your' situation.

Typically looking under /var/log is a good place to start, but for 'business' systems, there may be legal or business requirements to keep X amount of files online or at least archived in an easily retrievable place. (for example).
This is why logrotate exists, to automatically handle this for you. Note that logrotate is a generic tool, it doesn't only handle that dir, it can tidy any dir you want.

On my personal laptop, I always use
Code:
dnf clean all
before updates.
Helps tidy stuff up and ensures that the meta file data used for the repos is always the latest.
Really, it's mainly the latter; they don't take up that much disk space.

HTH
 
Old 02-15-2024, 06:44 PM   #9
rufwoof
Member
 
Registered: Nov 2017
Distribution: Kernel+busybox+ssh+vnc+alsa (framebuffer)
Posts: 201

Rep: Reputation: Disabled
The likes of Fatdog use a sfs (squashed filesystem) as the main system. With that you can boot, configure things as you like, and then create a new version. Thereafter ... you boot that exact same 'clean' (fresh/new) configured system every time. Don't store any data files in that, save them elsewhere and its like booting a brand new session every time. For browser bookmarks, just store them elsewhere, I've set up a alt-spacebar key combination that presents my common bookmarks, so can alt-space and arrow keys (or mouse click) to a particular bookmark and have the browser launch that URL.

A nice feature is that if you screw up the system during a session then you just reboot. But you do have the bother of booting, making desired changes and forming a new sfs for any changes that you do want to have preserved. Typically you'll do that a lot at first, but decreases to rare/infrequent later.

And of course any hacks that may otherwise get to persist long term, hidden away somewhere within your system, are just zapped after a reboot.
 
Old 02-15-2024, 07:17 PM   #10
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,231

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Not the same as CCleaner, but these help:

https://dev.yorhel.nl/ncdu

https://github.com/muesli/duf
 
Old 02-16-2024, 01:17 PM   #11
niceflipper8827
Member
 
Registered: Sep 2023
Location: Washington State,USA
Distribution: ChromeOS,SlackWare,Android and Lubuntu
Posts: 68

Rep: Reputation: 2
I think that bleachbit would be a good analogue.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: BleachBit – A Quick And Best Way to Clean Up Your Linux System (Best CCleaner Alternative) LXer Syndicated Linux News 0 07-14-2017 08:36 PM
LXer: Stacer An Alternative To CCleaner And Bleachbit On Linux LXer Syndicated Linux News 0 05-27-2017 05:12 AM
LXer: BleachBit An Alternative To CCleaner On Linux LXer Syndicated Linux News 0 03-31-2015 09:42 PM
[SOLVED] ccleaner for ubuntu 11.04 jonnynitro138 Linux - Newbie 3 01-06-2012 07:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration