xdu as a Linux alternative to TreeSize Free
Updated
Our verdict
xdu is a solid replacement for TreeSize Free if you're comfortable with the terminal and don't need a GUI. It delivers fast, hierarchical disk usage analysis with human-readable output and supports filtering by depth and symbolic links. While it lacks export formats like CSV or HTML, its output can be redirected or piped for scripting. Users who rely on visual tree maps or point-and-click navigation will need to adjust, but for quick, automated, or remote system checks, xdu performs the core job well.
- License
- GPL-3.0
- Price
- Free
- Latest version
- 3.0
- Rating
- —
What works the same
- Both scan local file systems and show disk usage in a tree hierarchy
- Support filtering by directory depth
- Display sizes in human-readable units (KB, MB, GB)
- Handle symbolic links correctly during scans
- Allow output to be sorted by size
What is different
- xdu is command-line only; no GUI like TreeSize Free
- No built-in export to CSV, HTML, or XML formats
- Cannot open or import TreeSize Free saved scan files
- Lacks real-time updating and column-based filtering in interface
- No built-in duplicate file detection or permissions view
Opening your TreeSize Free files
xdu cannot open or import files saved by TreeSize Free. TreeSize Free uses its own binary or XML format for saved scans, which xdu does not support. There is no direct file compatibility between the two tools. However, you can redirect xdu's text output to a file using shell redirection (e.g., xdu /path > report.txt), which allows basic sharing and scripting but lacks structured formatting like CSV or HTML.
Switching from TreeSize Free to xdu, step by step
- Install xdu using your package manager:
sudo apt install xduon Debian/Ubuntu - Run
xdu /your/pathto scan a directory, replacing/your/pathwith the target folder - Use
--depth Nto limit how many levels deep xdu scans - Redirect output to a file with
xdu /path > report.txtfor sharing or logging - Pipe xdu output to tools like
less,grep, orsortfor filtering and analysis - Replace TreeSize Free scheduled scans with a cron job running xdu
Key features of xdu
- Fast, single‑process scanning
- Tree‑structured output
- Human‑readable size units
- Optional depth limit
- Supports symbolic links
- Can be piped to other tools
How to install xdu on Linux
sudo apt install xdusudo apt install xduFrequently asked questions
Can xdu show the largest directories at the top?
Yes, pipe xdu output to sort: xdu /path | sort -k1 -hr to sort by size descending.
Is xdu available on non-Debian systems?
It's packaged in Debian and Ubuntu; other distributions may require building from source.
Does xdu work over SSH on remote servers?
Yes, xdu runs in the terminal and is ideal for remote use via SSH, often more efficiently than GUI tools.