Byron / dua-cli

View disk space usage and delete unwanted data, fast.
https://lib.rs/crates/dua-cli
MIT License
4.14k stars 113 forks source link

Non-interactive tree output #264

Open multimeric opened 2 months ago

multimeric commented 2 months ago

By default dua some_dir reports a flat file hierarchy. However, it would be useful to generate a tree, but non-interactively. My use case is sharing a disk usage report with someone, which can't be done in interactive mode, and the current behaviour isn't informative enough.

I wonder if a --depth <int> flag could be added to the uninteractive command that allows a tree output? It should default to 1 which is the current behaviour.

Byron commented 2 months ago

Thanks for the suggestion! It seems to me that PDU might be exactly what you want.

It's an auto-tree, essentially, and it's faster than dua as well.

However, I think the particular implementation suggested here seems like a good fit and nice to have, so let's keep it in case anyone comes along to implement it.

multimeric commented 2 months ago

Thanks for the recommendation. This isn't a good reason, but we use dua in our HPC facility and for admin + docs reasons, it would be easier to have one tool that does both the interactive stuff and uninteractive reporting.