Last Updated on September 1, 2020
You often hear that disk space is cheap and plentiful. And it’s true that a 4TB mechanical hard disk drive currently retails for less than 100 dollars. But like many users I’ve migrated to running Linux on M.2 Solid State Drives (SSDs). They are NVMe drives reaching read and write speeds of over 5,000MB/s. That’s over 20 times faster than a 7,200 RPM traditional hard drive.
M.2 SSDs do functionally everything a hard drive does, but help to make a computer feel far more responsive. M.2 are NVMe drives which reduce I/O overhead and brings various performance improvements relative to previous logical-device interfaces, including multiple long command queues, and reduced latency. M.2 drives are more expensive than mechanical hard drives in terms of dollar per gigabyte. And M.2 with really large capacities are thin on the ground and expensive, so most users settle for lower capacity drives.
Whatever the size of the hard disk, my disks always fill up over time; it seems data expands to fill any void. This is partly because I experiment with lots of distributions and software. But hard disks always seem to fill up by themselves. Whether you use M.2, other type of SSD, or mechanical hard disk drives, you cannot afford to be rash with storage. When a hard disk is full, it can be very time consuming to sort out and remove offending files and directories.
Linux distributions come supplied with utilities to explore disk usage. For example, du is a standard tool used to estimate file space usage; space being used under a particular directory or files on a file system.
du shows directories which are taking up space. And you can combine du with other command-line utilities such as grep and sort to make the output more meaningful. But there are many alternatives.
dutree is a command line tool to analyze disk usage. It’s name derives from Durep and Tree.
dutree is free and open source software.
It’s Linux, so there’s multiple ways to install this utility. As my main distro is Arch, I usually gravitate towards the Arch User Repository (AUR) when installing packages. And there’s a package in AUR for dutree. For other distributions, there may be a simple package to install. But I haven’t done any investigation in this respect.
You can also install the software with cargo, Rust’s package manager with the command “cargo install dutree” at a shell. Cargo makes it easy to get up and running by downloading a Rust project’s dependencies, compiling the project, making packages, and more.