Master Linux Disk Usage Visualization with Dutree: Install, Run, and Advanced Options
This guide explains how to install the Dutree command‑line tool on Linux, demonstrates basic and advanced usage such as scanning specific directories, limiting depth, excluding paths, changing units, exporting results, and using interactive mode to visualize filesystem disk consumption.
Dutree is a command‑line utility that visualizes directory structures and file sizes as a tree, helping users quickly identify large directories and manage disk space on Linux systems.
Dutree Overview
Dutree sorts files and directories by size and displays them in an intuitive tree diagram, making it easy to locate space‑hungry locations.
Installation
On most Linux distributions, install Dutree via the package manager. For Ubuntu/Debian:
sudo apt-get update
sudo apt-get install dutreeOther distributions can use their respective package managers.
Basic Usage
Run the tool in a terminal with the dutree command. It scans the current directory and its sub‑directories, then prints a tree with size information. dutree Example output:
/home/user
├── Documents 15.5 GB
│ ├── Work 8.2 GB
│ ├── Projects 5.3 GB
│ └── Reports 2.0 GB
├── Downloads 20.1 GB
├── Pictures 10.2 GB
└── Videos 30.5 GB
Total: 76.3 GBScanning a Specific Directory
Specify a path to analyze, e.g., the /home directory: dutree /home Result shows the size breakdown for /home and its subfolders.
Limiting Tree Depth
Use the -d option to restrict the displayed depth. To show only the first two levels: dutree -d 2 Output displays top‑level directories with their total sizes and the immediate sub‑directories.
Additional Features
Exclude Files or Directories
Exclude paths from the scan with --exclude:
# Exclude all .git directories
dutree --exclude .gitDisplay Sizes in Different Units
Choose units such as MB, GB, etc., using --unit:
# Show sizes in megabytes
dutree --unit MBExport Results to a File
Redirect output to a file for later analysis:
# Save output to dutree_output.txt
dutree > dutree_output.txtShow Hidden Files
Include hidden files in the report with the --all flag:
# Include hidden files
dutree --allInteractive Mode
Enter an interactive view where arrow keys navigate the tree and sorting can be changed on the fly:
# Start interactive mode
dutree --interactiveConclusion
By installing and using Dutree, Linux users gain a powerful way to visualize and manage filesystem disk usage, which can improve system performance and stability.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
