** 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. 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. So, this limits it's practical usefulness as well. + 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. While the above is technically a right decision for the same reasons - as tree defaulting to just show size of the directory as block sizes, - this is misleading since there's no way to differentiate what's a - partial size, and what's the correct real calculation in the above - scenario. + 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 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 "*". + 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 ProcVersionSignature: Ubuntu 4.18.0-13.14-generic 4.18.17 Uname: Linux 4.18.0-13-generic x86_64 NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair 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.conffile..etc.apport.crashdb.conf: [modified] mtime.conffile..etc.apport.crashdb.conf: 2019-01-15T04:51:59.517661
-- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1813601 Title: tree and better recursive directory sizing To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/tree/+bug/1813601/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs