tree and better recursive directory sizing
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
tree (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Currently `tree -dh`/`tree -h` simply shows the size of the directory nodes that tend to be 4K in a default ext4 installation with 4K block sizes. While this is not very useful in terms of UX, it does however have it's use by not spending a whole lot of IO on calculating recursive sizes. However, in addition to the current mode, it would be great to have an option, that recursively adds up the size of the its contents and displays the total size of the directory (inclusive of all hidden and dot files), instead of just the directory node size.
UPDATE: There's the "--du" option, that the upstream author was gracious enough to point out to me. This is great and solves the problem in theory.
But in practice, when used with large trees (for example the $HOME folder), the usefulness vanishes rather quickly due to the following reasons:
1. Output is usually very large. So, it isn't very practical to use this option in non-automated scenario. So we probably want to limit depth with "-L" in most occasions.
2. However, while using "-L", "--du" behaves in a way where it only calculates partial sizes for the leaf trees that are larger than the given depth. While this is probably the best default to have, with the exception of some specific scenarios where this is what is required, this limits it's practical usefulness as well with most large trees.
3. In the above scenario, the problem is compounded by the fact that one can easily be mislead, since there's currently no way to differentiate what's a partial size, and what's the correct real calculation of the full size.
POTENTIAL SOLUTIONS:
1 & 2. It would be nice to have an additional option that calculates the forces the tree traversal for the calculating sizes alone, so that real sizes are displayed when used along with the "-L" option. This can also be in the form of another depth, that default to say "-1", meaning a full traversal, or positive numbers for limiting the size traversals.
3. This can easily be solved by suffixing the size with something, for the sake of a better suffix "*".
ProblemType: Bug
DistroRelease: Ubuntu 18.10
Package: tree 1.7.0-5
ProcVersionSign
Uname: Linux 4.18.0-13-generic x86_64
NonfreeKernelMo
ApportVersion: 2.20.10-0ubuntu13.1
Architecture: amd64
CurrentDesktop: GNOME
Date: Mon Jan 28 18:49:37 2019
Dependencies:
gcc-8-base 8.2.0-7ubuntu1
libc6 2.28-0ubuntu1
libgcc1 1:8.2.0-7ubuntu1
libidn2-0 2.0.5-1
libunistring2 0.9.10-1ubuntu1
InstallationDate: Installed on 2019-01-01 (27 days ago)
InstallationMedia: Ubuntu 18.10 "Cosmic Cuttlefish" - Release amd64 (20181017.3)
SourcePackage: tree
UpgradeStatus: No upgrade log present (probably fresh install)
modified.
mtime.conffile.
description: | updated |
summary: |
- tree and recursive directory sizing + tree and better recursive directory sizing |
description: | updated |
information type: | Public → Public Security |
information type: | Public Security → Private Security |
information type: | Private Security → Public |
Hi,
On Wed, 30 Jan 2019 at 20:15, Prasanna V. Loganathar <
<email address hidden>> wrote:
> ** Description changed:
>
> Currently `tree -dh`/`tree -h` simply shows the size of the directory
> nodes that tend to be 4K in a default ext4 installation with 4K block
> sizes. While this is not very useful in terms of UX, it does however
> have it's use by not spending a whole lot of IO on calculating recursive
> sizes. However, in addition to the current mode, it would be great to
> have an option, that recursively adds up the size of the its contents
> and displays the total size of the directory (inclusive of all hidden
> and dot files), instead of just the directory node size.
>
> UPDATE: There's the "--du" option, that the upstream author was gracious
> enough to point out to me. This is great and solves the problem in
> theory.
>
OK, I opened up two terminal windows and was in my home directory in both
of them.
In one window I typed in
tree --du
And this gave a lot of output and a final figure.
In the other window I typed in
du -s
And this output the final figure with a dot at the end of the line.
Is this of use to you?
BW,
Ian
-- www.accu. org /sites. google. com/site/ ianbruntlett/ /sites. google. com/site/ ianbruntlett/ home/free- software
-- ACCU - Professionalism in programming - http://
-- My writing - https:/
-- Free Software page -
https:/