[SOLVED]Nemo: How to sort directory trees by data usage not item count?

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
oldgranola
Level 3
Level 3
Posts: 187
Joined: Fri Sep 05, 2014 1:39 am

[SOLVED]Nemo: How to sort directory trees by data usage not item count?

Post by oldgranola » Sun Feb 11, 2018 3:45 pm

This has to be a basic question. I am trying to put the hard drive on a little diet. However, I am having difficulty seeing just which directories are eating so much space. I cleaned and archived the usual suspects on another drive such as photos/images, videos etc. Same for downloads, deleted most. But the 500GB disk is still nearly full. I figure the issue(s) are program caches as I really don't have THAT much installed. Don't remember taking a system snapshot yet, no room now. So I tried using nemo to sort the file system and the 'home' directory tree on the 'size' tab, however, it sorts by the number of items not the amount of data in each directory. Can I get nemo to do that or is there a better tool? .
Running LM17.3
Thanks
Last edited by oldgranola on Sat Feb 17, 2018 3:01 pm, edited 1 time in total.
comadore, pcDOS, hpux, solaris, vms-vax ....blah blah blah..
Yet I'm still a fn nooob

User avatar
Flemur
Level 16
Level 16
Posts: 6271
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Nemo: How to sort directory trees by data usage not item count?

Post by Flemur » Sun Feb 11, 2018 4:18 pm

oldgranola wrote:
Sun Feb 11, 2018 3:45 pm
Can I get nemo to do that or is there a better tool?
Probably not nemo.

There's "baobab" = "Disk Usage Analyzer" in your menus...probably; if not, install it.

I usually use "du" when I'm trying to find big files or similar functions; it's got tons of options.
Try these ("du" doesn't change any files or anything like that):

Code: Select all

du $HOME 
du -a $HOME | sort -n
sudo du -d1 /
sudo du  -h -d1 / 2>/dev/null
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
Mint 18.3 Xfce/fluxbox/pulse-less
Xubuntu 17.10/fluxbox/pulse-less

oldgranola
Level 3
Level 3
Posts: 187
Joined: Fri Sep 05, 2014 1:39 am

Re: Nemo: How to sort directory trees by data usage not item count?

Post by oldgranola » Sun Feb 11, 2018 4:56 pm

thanks flemur,
Looks like something to learn and try. I'll readup more and give it a whirl. Sun came out so a little hike first:>)
comadore, pcDOS, hpux, solaris, vms-vax ....blah blah blah..
Yet I'm still a fn nooob

User avatar
AZgl1500
Level 9
Level 9
Posts: 2860
Joined: Thu Dec 31, 2015 3:20 am
Location: Oklahoma where the wind comes sweeping down the plains
Contact:

Re: Nemo: How to sort directory trees by data usage not item count?

Post by AZgl1500 » Sun Feb 11, 2018 11:50 pm

I just ran that tool, and it says there is an error scanning the 'cache' directory:

"No Permissions"

is that normal? or how can that be fixed?
Attachments
Error Scanning Cache.png

User avatar
austin.texas
Level 20
Level 20
Posts: 12054
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: Nemo: How to sort directory trees by data usage not item count?

Post by austin.texas » Mon Feb 12, 2018 12:19 am

AZgl1500 wrote:
Sun Feb 11, 2018 11:50 pm
I just ran that tool, and it says there is an error scanning the 'cache' directory:
"No Permissions"
is that normal? or how can that be fixed?
That is "normal". It can be ignored.
Mine:
find: ‘/home/username/.cache/dconf’: Permission denied
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018

User avatar
tomcashen
Level 1
Level 1
Posts: 14
Joined: Thu Dec 14, 2017 2:08 pm

Re: Nemo: How to sort directory trees by data usage not item count?

Post by tomcashen » Mon Feb 12, 2018 12:51 am

I have been using qdirstat on Linux.
https://github.com/shundhammer/qdirstat

I like the visual representation as well as the ability to work with files directly from the program.

This program started as windirstat for some other OS. It has always been free and open source. I started using it years ago in my xp days. It is, I believe, the default disk analyzer for another proprietary OS that rhymes with grapple.

It is in the Mint software center as k4dirstat. I have this version installed currently.

Qdirstat is a rewrite without kde dependencies. I have run both on Mint 18.3 with no problems.

The only thing missing from the Linux ports is the ability to "show free space" in the graphic. But still. I run it on every machine I own. My laptop is dual boot with win7 and Mint. I have it installed on both.

User avatar
Flemur
Level 16
Level 16
Posts: 6271
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Nemo: How to sort directory trees by data usage not item count?

Post by Flemur » Mon Feb 12, 2018 11:05 am

AZgl1500 wrote:
Sun Feb 11, 2018 11:50 pm
I just ran that tool, and it says there is an error scanning the 'cache' directory:
"No Permissions"
is that normal? or how can that be fixed?
It's sort-of normal, but it's generally a bad idea to have unreadable files in your $HOME, so I fix it:

Code: Select all

sudo chown -R $USER:$USER $HOME/.cache
sudo chmod -R +r $HOME/.cache
sudo chmod -R +w $HOME/.cache
You might even want to leave out the "/.cache" part...

Or you could do

Code: Select all

gksudo baobab
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
Mint 18.3 Xfce/fluxbox/pulse-less
Xubuntu 17.10/fluxbox/pulse-less

User avatar
austin.texas
Level 20
Level 20
Posts: 12054
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: Nemo: How to sort directory trees by data usage not item count?

Post by austin.texas » Mon Feb 12, 2018 11:16 am

Flemur wrote:
Mon Feb 12, 2018 11:05 am
It's sort-of normal, but it's generally a bad idea to have unreadable files in your $HOME, so I fix it:
Unfortunately, when you log out and back in, it will be re-created exactly the same as before you fixed it. It is a "bug". (And it doesn't have any ill effects.)
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018

User avatar
Flemur
Level 16
Level 16
Posts: 6271
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Nemo: How to sort directory trees by data usage not item count?

Post by Flemur » Mon Feb 12, 2018 12:27 pm

austin.texas wrote:
Mon Feb 12, 2018 11:16 am
Unfortunately, when you log out and back in, it will be re-created exactly the same as before you fixed it.
That doesn't happen here, dunno why; FWIW, I usually log into fluxbox, but sometimes xfce.
(And it doesn't have any ill effects.)
Well, it had a minor ill effect in that the guy who was trying to analyze disk space usage shouldn't have his user account's disk space hidden from him.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
Mint 18.3 Xfce/fluxbox/pulse-less
Xubuntu 17.10/fluxbox/pulse-less

Cosmo.
Level 23
Level 23
Posts: 17824
Joined: Sat Dec 06, 2014 7:34 am

Re: Nemo: How to sort directory trees by data usage not item count?

Post by Cosmo. » Mon Feb 12, 2018 3:44 pm

austin.texas wrote:
Mon Feb 12, 2018 11:16 am
[Unfortunately, when you log out and back in, it will be re-created exactly the same as before you fixed it.
That is not perfectly correct. The problematic objects get created, when the update manager refreshes the update list. With the default settings this does not happen immediately after login in, but after 10 minutes. And if you correct this mistake and your session takes long enough, the update manager refreshes again and the objects reappear again. The culprit is indeed the update manager since version 5.x (Mint 18 and above).

oldgranola
Level 3
Level 3
Posts: 187
Joined: Fri Sep 05, 2014 1:39 am

Re: Nemo: How to sort directory trees by data usage not item count?

Post by oldgranola » Fri Feb 16, 2018 12:38 pm

Thanks, experienced this too. Unless that list eats up a large amount, not super important to the task. Need to carve out more time to work on this. So far, using 'du' and disk usage analyzer on my 'home' dir isn't adding up to the disk usage so have to scan the whole drive. Is it possible I have bad sectors? What is the best tool for that?
comadore, pcDOS, hpux, solaris, vms-vax ....blah blah blah..
Yet I'm still a fn nooob

oldgranola
Level 3
Level 3
Posts: 187
Joined: Fri Sep 05, 2014 1:39 am

Re: Nemo: How to sort directory trees by data usage not item count?

Post by oldgranola » Fri Feb 16, 2018 1:04 pm

BTW, where are the Update Manager files kept? I'm getting a notice for update manager now "write error-write (28:No space left on device). I have to just start moving stuff off so I can even do work to analyze....
comadore, pcDOS, hpux, solaris, vms-vax ....blah blah blah..
Yet I'm still a fn nooob

User avatar
austin.texas
Level 20
Level 20
Posts: 12054
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: Nemo: How to sort directory trees by data usage not item count?

Post by austin.texas » Fri Feb 16, 2018 1:20 pm

oldgranola wrote:
Fri Feb 16, 2018 1:04 pm
BTW, where are the Update Manager files kept?
The Update Manager downloads the package files (.deb files) into /var/cache/apt/archives/
You can clean out the old used ones with the command:

Code: Select all

apt autoclean
You can clean out ALL the .deb files with the command:

Code: Select all

apt clean
Those .deb files have already been used to install your programs, and are no longer needed.
oldgranola wrote:
Fri Feb 16, 2018 1:04 pm
I'm getting a notice for update manager now "write error-write (28:No space left on device). I have to just start moving stuff off so I can even do work to analyze....
Try the Disk Usage Analzyer mentioned previously by Flemur

Also, this command will give you some info:

Code: Select all

sudo du / -xh | sort -hr | head -n 15
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018

oldgranola
Level 3
Level 3
Posts: 187
Joined: Fri Sep 05, 2014 1:39 am

Re: Nemo: How to sort directory trees by data usage not item count?

Post by oldgranola » Fri Feb 16, 2018 11:08 pm

thanks Austin. Ran the deb clean. Unfortunately that DU cmd fails do to insufficient disc space. Weird . I've moved a bunch of stuff using nemo to an external drive. My Home dir is only 20GB out of a 500GB disk according to disk analyser. It however barfs when I run it against the file system.
comadore, pcDOS, hpux, solaris, vms-vax ....blah blah blah..
Yet I'm still a fn nooob

User avatar
austin.texas
Level 20
Level 20
Posts: 12054
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: Nemo: How to sort directory trees by data usage not item count?

Post by austin.texas » Sat Feb 17, 2018 12:35 am

Boot the live Mint USB or DVD and run Disk Usage Analyzer from there.
You will have to mount your 20GB root partition.
After mounting, you would get some usage information from

Code: Select all

inxi -Dp
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018

oldgranola
Level 3
Level 3
Posts: 187
Joined: Fri Sep 05, 2014 1:39 am

Re: Nemo: How to sort directory trees by data usage not item count?

Post by oldgranola » Sat Feb 17, 2018 2:34 am

Thanks Austin,
Last edited by oldgranola on Sat Feb 17, 2018 3:01 am, edited 1 time in total.
comadore, pcDOS, hpux, solaris, vms-vax ....blah blah blah..
Yet I'm still a fn nooob

oldgranola
Level 3
Level 3
Posts: 187
Joined: Fri Sep 05, 2014 1:39 am

Re: Nemo: How to sort directory trees by data usage not item count?

Post by oldgranola » Sat Feb 17, 2018 2:38 am

Thanks Austin,
will do. Have to make that usb boot disk again, lost the original. But After moving everything off I thought I could safely do, disk manager (run as gksudo baobab with env retained, finally came up with a result since this am.
"
TOTAL 411.4 GB
TIMESHIFT 279.2 gb
>SNAPSHOTS-BOOT 279.2 gb
>all esle in the low kb range
VAR 97.7 gb
>LIB 65.7 gb
>>LOG 32.7 gb
>>cache 0.138 gb
>>backups 0.016gb
>>and a bunch of mb stuff
HOME 20.5 GB
USR 9.5 gB
ROOT 1.8 gb
lIB 1.6 gB
opt .723 gb
and a bunch of smaller stuff.

So seems timeshift is killing me. Did I miss configure? Thought it was a nifty way to keep system backups. Can I just delete?
Also, is it normal for /LIB to get so big?
Crazy eh?

Cheers, happy Presidents day, er maybe not this one
comadore, pcDOS, hpux, solaris, vms-vax ....blah blah blah..
Yet I'm still a fn nooob

User avatar
austin.texas
Level 20
Level 20
Posts: 12054
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: Nemo: How to sort directory trees by data usage not item count?

Post by austin.texas » Sat Feb 17, 2018 10:39 am

oldgranola wrote:
Sat Feb 17, 2018 2:38 am
TOTAL 411.4 GB
TIMESHIFT 279.2 gb
>SNAPSHOTS-BOOT 279.2 gb
>all esle in the low kb range
VAR 97.7 gb
>LIB 65.7 gb
>>LOG 32.7 gb
>>cache 0.138 gb
>>backups 0.016gb
>>and a bunch of mb stuff
HOME 20.5 GB
USR 9.5 gB
ROOT 1.8 gb
lIB 1.6 gB
opt .723 gb
and a bunch of smaller stuff.

So seems timeshift is killing me. Did I miss configure? Thought it was a nifty way to keep system backups. Can I just delete?
Also, is it normal for /LIB to get so big?
For comparison, here is mine:

Code: Select all

dan@skynet1 ~ $ sudo du / -xh | sort -hr | head -n 15
[sudo] password for dan: 
7.3G	/
5.2G	/usr
2.4G	/usr/share
2.1G	/usr/lib
1.1G	/usr/lib/x86_64-linux-gnu
706M	/lib
534M	/var
444M	/lib/modules
413M	/usr/bin
399M	/usr/share/icons
396M	/home
383M	/home/dan
315M	/opt
312M	/var/lib
305M	/usr/share/libreoffice
dan@skynet1 ~ $ sudo du / -xhd1 --exclude={/run,/proc,/dev,/media,/mnt,/sys,/tmp}
4.0K	/srv
17M	/bin
19M	/sbin
4.0K	/cdrom
5.2G	/usr
396M	/home
534M	/var
16K	/lost+found
706M	/lib
4.0K	/lib64
26M	/etc
129M	/boot
315M	/opt
240K	/root
7.3G	/
dan@skynet1 ~ $ 
Your /var is bloated. You can safely delete all of the .deb files found in /var/cache/apt/archives/
You show 32.7GB in /var/lib/log but I don't know what that is. I have no such directory. Log files are in /var/log/ - and my /var is 534MB.
Your /root shows 1.8GB. I suspect that you have to open your file manager as root and empty root's trash. Check to see what is in there first.
Your /lib might be big from a lot of installed programs (?). Games?
I can't advise you on deleting the Timeshift files. I don't know what that would do... (never used it). I boot the live Mint and run fsarchiver and store the archive of the root partition on a big hard drive, out of the way.
I use grsync to back up my personal files on my /DATA partition.
oldgranola wrote:
Sat Feb 17, 2018 2:38 am
Cheers, happy Presidents day, er maybe not this one
I try to stay away from politics here (forum rules), but I understand and agree with the sentiment about the current Resident.
Last edited by austin.texas on Sat Feb 17, 2018 11:06 am, edited 2 times in total.
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018

User avatar
AZgl1500
Level 9
Level 9
Posts: 2860
Joined: Thu Dec 31, 2015 3:20 am
Location: Oklahoma where the wind comes sweeping down the plains
Contact:

Re: Nemo: How to sort directory trees by data usage not item count?

Post by AZgl1500 » Sat Feb 17, 2018 10:54 am

oldgranola wrote:
Sat Feb 17, 2018 2:38 am
Thanks Austin,
will do. Have to make that usb boot disk again, lost the original. But After moving everything off I thought I could safely do, disk manager (run as gksudo baobab with env retained, finally came up with a result since this am.
"
TOTAL 411.4 GB
TIMESHIFT 279.2 gb
>SNAPSHOTS-BOOT 279.2 gb
>all esle in the low kb range
and a bunch of smaller stuff.

So seems timeshift is killing me. Did I miss configure? Thought it was a nifty way to keep system backups. Can I just delete?

Austin worked me through storing all of the Timeshift and Snapshots onto my ExtUSB HDD

it works like a charm, none of those files are stored on my /root directory any more.

Here is the thread where the whole forum here pitched in.
The last 4 or 5 posts is where the real action finally happens:
I wrote a mini-tutorial explaining how to do it.

viewtopic.php?f=90&t=263360#p1426788

oldgranola
Level 3
Level 3
Posts: 187
Joined: Fri Sep 05, 2014 1:39 am

Re: Nemo: How to sort directory trees by data usage not item count?

Post by oldgranola » Sat Feb 17, 2018 2:22 pm

Thanks everybody! Great to learn a little about 'du' and baobab.
Austin, your suggestions led me to figure out that I had timeshift missconfigured, the main culprit. Forgot I even had it. Was able to just run timeshift and get rid of way too many old backups and configure to my liking. The bloated Var (kinda feels strange for someone to call out your bloat:>) were old virtual machine images in libvirt, I'll keep. AZgl1500, also very helpful, thanks for pointing out that thread.
comadore, pcDOS, hpux, solaris, vms-vax ....blah blah blah..
Yet I'm still a fn nooob

Post Reply

Return to “Newbie Questions”