announcing Disk Top Ten (dtt) 1.0a, a "where's my disk space" utility
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
This is the neatest piece of code I've seen in months
You're going to make me blush. I'm glad you appreciate it. And thank you for the suggestions.
Quote:
Originally Posted by lemonade
Missing --human-readable option [...] And also --block-size
Yes, and I'm looking at this for a future release, plus more.
First, dtt installers should have the option to configure the default unit to match the df/du on the target platform.
In the case of Slackware 15.0 that runs Gnu df/du, that would be the customary kilobyte (1024 bytes).
In the case of a system that follows the Unix standard, for example FreeBSD, that would be the customary block (512 bytes).
And dtt should offer the option to override the default unit just as you suggest.
It should support -b, -k, -m, --block-size|-B, and --human-readable|-h.
Easy comparison between the outputs of df, du, and dtt was an early important design feature.
dtt was originally written over ten years ago for a non-Linux Unix.
Historically, one block was equivalent to the near-universal 512-byte disk sector.
Consequently, Unix df/du report in 512-byte units.
So this explains why dtt reports in 512-byte units.
Gnu df/du were intentionally made incompatible with Unix in that regard.
Reporting in filesystem block units is another option I want to support.
It's crazy that neither Unix df/du nor Gnu df/du report disk space using the block size.
Suppose your blocksize is 4096 bytes, and there is 1 block free.
To report you have 4 free customary kilobytes or 8 free customary blocks is misleading.
It's more meaningful to report you have 1 free filesystem block.
Because you don't actually have 4 more, or 8 more, blocks available for allocation.
You have 1, and the next tiny file you create will allocate it.
Quote:
Originally Posted by lemonade
and maybe --one-file-system
As it stands, dtt does not cross filesystem boundaries.
In a future release I'd like to lift that restriction.
At that point it would make sense to consider which mode will be the default, and offer an override option.
Well yes, but actually no. That approach can only tell you the ten largest objects one level below a given root node. dtt goes further. It actually focuses in on the ten largest individual subtrees at any level below the root node. When your question is where exactly did my space go, it's a much more helpful answer.
Thanks for the clarification Ed. I figured that out after posting but left it up to get the full explanation from you anyway so thanks for that.
As others have mentioned, a "human readable" option would be nice. Also perhaps exiting on an "unknown option" would be better, rather than continuing to search the current directory for the top ten files after spitting out the error. Just a thought.
Thanks for sharing. Always nice to see interesting solutions for age old problems.
perhaps exiting on an "unknown option" would be better
Thank you, I will consider it. I tend to follow the Robustness Principle when accepting input: "be conservative in what you do, be liberal in what you accept from others." (J. Postel)
As it stands, dtt does not cross filesystem boundaries.
In a future release I'd like to lift that restriction.
At that point it would make sense to consider which mode will be the default, and offer an override option.
I would prefer a default of not to cross filesystem boundaries.
this can be easily solved by a .rc file, which [may] contain personalized defaults for this and for any other settings.
I am pretty certain @metaed was referring to possibly adding program options to dtt. He asked for preferences, I responded with mine. Which ever @metaed decides as the default (currently not to cross filesystem boundaries) adding an option to cross (or not to) filesystem boundaries is a nice idea.
One could also use an alias, once the option exist, which it currently does not.
This is a bugfix, performance, and refactoring release. It prepares the code for future release of features we've been talking about.
Minor functional differences:
* Return success code when --help requested
* Reduce wasted CPU
The biggest change is mostly invisible, unless you looked at the technical paper for version 1.0: breaking up the monolithic lookup phase using Literate Programming techniques. This is what saved some CPU ticks, but the main reason for the refactor was to make it much easier to add new features.
Also in this release:
* Test all counting methods
* Clean up documentation
* Add roadmap
* Add changelog
* Add acknowledgements
I would prefer a default of not to cross filesystem boundaries.
Personally, so would I. But that’s a conflict with the requests I’m seeing to make dtt options work like du and df options. Unix df has the x option, and Gnu df has the --one-file-system|x option, because du crosses file system boundaries by default. So I’m leaning toward making dtt cross file system boundaries by default, and offering the --one-file-system|x option. You and I would use an alias to correct the behavior to our personal preference.
Personally, so would I. But that’s a conflict with the requests I’m seeing to make dtt options work like du and df options. Unix df has the x option, and Gnu df has the --one-file-system|x option, because du crosses file system boundaries by default. So I’m leaning toward making dtt cross file system boundaries by default, and offering the --one-file-system|x option. You and I would use an alias to correct the behavior to our personal preference.
What's your reaction?
If you want to make a general tool you need have a lot of options to make it really general and configurable and also you need to make a conf file (or something similar) to be able to define user specific defaults. That is the usual way. As you have already made it check du, ncdu, df, free and probably other tools, pick the flags you [may] find useful and adopt them.
Don't forget that your personal preferences are not necessarily important to others.
Personally, so would I. But that’s a conflict with the requests I’m seeing to make dtt options work like du and df options. Unix df has the x option, and Gnu df has the --one-file-system|x option, because du crosses file system boundaries by default. So I’m leaning toward making dtt cross file system boundaries by default, and offering the --one-file-system|x option. You and I would use an alias to correct the behavior to our personal preference.
What's your reaction?
Well your the author. Since you asked I like the current default. Your unique masterpiece is dtt, it doesn't have to mirror the behavior of other programs such as du and df, both of which I use. Of course you are the author so I will I'm good with whatever you decide. Great program by the way, I like to what dtt brings to the mix. Both du and df are useful utilities now we have another useful utility that present the info in a different way. Always nice to have alternatives.
So dtt excludes "/usr/lib64" "/usr/local" etc. because everything under those is supposed to be accounted for in deeper paths, is that correct? However, I'm not sure it's working properly, as I have I have 1.4GB of files in /usr/lib64:
Code:
du -hc /usr/lib64/*.so.* | tail -n 1
1.4G total
ls -lh /usr/lib64/ | head -n 1
total 1.8G
and I think I'd expect that to show up above /usr/share/locale.
I have 1.4GB of files in /usr/lib64 [...] and I think I'd expect that to show up above /usr/share/locale.
Thank you for giving it a test drive, and for your helpful comments!
This looks like dtt doing what it's really good at: elevating deep subtrees that make a disproportionally large contribution to the total. From the manual:
If any directory would be in the top ten list along with one or more of its descendant objects, the descendant objects are reported, not the directory.
What you're finding is that /usr/lib64/libreoffice/program is so large on its own that it merits being listed as one of the top ten objects, and so disproportionally large compared to other objects in /usr/lib64 that it's the only one that made the grade.
You could of course re-run dtt starting from /usr/lib64 to see what the other outliers are just in that subtree. Or, if you were going to alias this particular search and reuse it, it might be helpful if you could exclude /usr/lib64/libreoffice. Not something I've needed, so I haven't thought about implementing --exclude or --exclude-from. Until now, that is.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.