How to Use erdtree: The Beginner's Guide (First Install, First Tree, the Config-File Lesson, and the Ignore-Rules Arc)

CodexFuse Team · 2026-11-07T00:48:17.818Z · 15 min read min read

How to Use erdtree?

Learning how to use erdtree takes seven moves: install version 3.1.2, confirm it with erd --version, draw your first tree, trim the depth, trust the ignore rules, sort by size, and save your defaults in a config file. This erdtree tutorial follows the official README for the current release, v3.1.2, with every fact checked as of November 2026.

Erdtree is a directory tree cli that draws your folders as a tree and reports the disk usage of every file and folder. It is a tree command alternative that behaves like a little bit of du, tree, find, wc, and ls in one command, in the project's own words.

The ignore rules only make sense if you know how Git tracks files. The Git beginner guide on CodexFuse covers repositories, commits, and ignore files, and erdtree reads the same .gitignore files that Git reads.

This guide opens the file-tree-cli lane in the dev-tools terminal cluster, and the server-admin base pillar is the VPS hosting guide on CodexFuse, which covers the Linux server where tools like this one do their real work.

  1. Install erdtree 3.1.2 from cargo, Homebrew, Scoop, or a prebuilt binary.
  2. Run erd --version to confirm the install.
  3. Run erd in a project folder to draw your first tree.
  4. Add -L 2 and -H to keep the first view short and readable.
  5. Trust the ignore rules: .gitignore entries and hidden files stay out by default.
  6. Sort by size with -s size and switch layouts with -y inverted.
  7. Save your defaults in .erdtree.toml so every run looks the same.

What Is erdtree?

What is erdtree, in one sentence? Erdtree is a modern, cross-platform, multi-threaded filesystem and disk-usage utility that is aware of .gitignore and hidden file rules, in the project's own words.

Erdtree is not a rewrite of the tree command, and the README says so plainly: it is not a 1-to-1 port, and there are more differences than similarities. The spirit of tree is there, but erdtree adds disk usage, parallel traversal, ignore rules, sorting, icons, and layouts.

The name is a reference to an object of worship in Elden Ring, according to the README FAQ. That is also why a search for erdtree returns game guides next to the tool: the game owns the word in search, and the tool borrows it.

The project started on 5 May 2022, and it is written in Rust under the MIT license. As of this run it has 2,604 GitHub stars and 72 forks, with 36 open issues.

The repository is 1,647 days old, which is 4.5 years, and it works out to 36.17 stars per fork with only 1.38 open issues per 100 stars. The last code push landed 902 days before this guide, which is 2.5 years, so this is a stable tool, not a fast-moving one.

The current release is v3.1.2, published on 2 July 2023, which is 1,224 days before this guide, or 3.4 years. The binary is erd in version 3, not et, and every command in this guide uses erd. CodexFuse offers no erdtree tool, so this guide teaches the command itself.

The 3.1.x line moved fast at the end: version 3.1.1 landed 1 day before 3.1.2, and 3.0.1 was 34 days earlier, after 21 stable releases in total. The old 1.1.0 release is 1,361 days old, which is why its et binary and old flags should not be copied.

How Do You Install erdtree?

An erdtree install starts with the route that matches your machine, and the README lists six of them. The simplest is the package manager you already use, and cargo is the fallback that works everywhere Rust runs.

RouteCommandNotes
Cargocargo install erdtreeNeeds the Rust toolchain; non-Windows
Homebrewbrew install erdtreemacOS and Linux
Scoopscoop install erdtreeWindows
NetBSD pkginpkgin install erdtreeNetBSD only
Prebuilt binaryGitHub releases pageSeven assets for v3.1.2, all platforms
Master branchcargo install --git https://github.com/solidiquis/erdtree --branch masterUnreleased code; for testing only

Check the releases page before you install, because a newer version may exist by the time you read this. Apt and pacman are not official install routes, and neither are Chocolatey or winget, so do not copy those commands from roundup posts.

Windows users who build from crates.io need a nightly toolchain first, pinned to nightly-2023-06-11 in the 3.1.2 README. The prebuilt Windows binary from the releases page skips that step entirely.

cargo install erdtree
brew install erdtree
scoop install erdtree
pkgin install erdtree

Verify the install with one command, and expect the version string to say 3.1.2. If your shell still finds an old et binary, that is the version 1 line, and the commands in this guide will not match it.

erd --version

How Do You Draw Your First Tree?

Your first tree is one word: erd with no arguments draws the current directory. Pass a folder to draw that folder instead, and the output lists every file and folder with its size.

erd
erd ~/projects/my-app
erd -L 2
erd -L 2 --human

Read the output from the bottom up in the default layout, because the root sits at the bottom with the total size. That feels backwards for one minute, and then it makes sense: the number you usually want is the total, and it is the first thing you see.

Limit the depth on your first run, because a full tree of a big project scrolls for pages. Two levels show the shape of the project, and the human flag turns raw byte counts into readable sizes.

Part of the outputWhat it means
Root at the bottomTotal disk usage of everything below it
Branch linesFolder nesting, one level per indent
Size before each namePhysical bytes by default; logical with -d logical
Missing hidden filesHidden and gitignored files stay out by default

What Do the Everyday Flags Do?

Five flags cover most daily use, and they combine freely. Learn these five first, and reach for the rest only when a specific job needs them.

FlagWhat it doesExample
-L, --levelLimits how deep the tree goeserd -L 2
-H, --humanShows sizes in readable unitserd -H
-s, --sortSorts by size, name, or dateerd -s name
-P, --pruneDrops empty directorieserd -P
--dirs-onlyShows folders only, sizes unchangederd --dirs-only
-I, --iconsShows file iconserd -I
erd -s name -P
erd --dirs-only -L 3
erd -I --human

Sorting defaults to size, smallest first, so the biggest folders sit at the bottom near the total. Name sorting reads like an alphabetical listing, and reverse size puts the biggest item first when you are hunting for space.

Icons are opt-in because they need a Nerd Font in your terminal to render. Without that font the icons show as boxes or question marks, so install a Nerd Font first and then add -I.

Why Are Some Files Missing? The Ignore-Rules Lesson

The most confusing moment in erdtree is the missing file, and it is a feature, not a bug. Erdtree respects .gitignore by default, so ignored files never appear in the tree and never count toward the totals.

The rule is per-directory, so every folder with its own .gitignore gets its own rules. A root .gitignore that ignores node_modules and a nested one that ignores a build folder both apply at the same time.

RuleDefaultOverride
.gitignore respectedOn-i, --no-ignore
Hidden filesOff-., --hidden
.git folder when hidden shownShown--no-git
Ignored files in totalsExcludedNone: ignored stays ignored
erd -i
erd -.
erd -. --no-git

Hidden files stay out by default for the same reason: a tree full of dotfiles hides the project. Add the hidden flag when you need to audit config files, and add --no-git when the .git folder would drown the output.

Disk audits on servers usually mean containers, and the Docker beginner guide on CodexFuse covers the containers whose layers fill disks. Run erd inside a project folder before you blame the container for the size.

How Does erdtree Measure Disk Usage?

Disk usage is the half of erdtree that tree never had, and it has two answers for every file. Physical size is the bytes actually stored on disk, and logical size is the bytes inside the file, and the two differ on sparse files and compressed files.

MetricWhat it countsFlag
PhysicalBytes stored on disk-d physical
LogicalBytes inside the file-d logical
LineLines of text-d line
WordWords of text-d word
BlockDisk blocks, Unix only-d block
erd -d logical
erd -d line
erd -y flat -d block -i -.

The last command matches du output: a flat layout, block sizes, no ignore rules, and hidden files shown. It is the README's own recipe for the day you need erdtree and du to agree.

Units are binary by default, so 1 KiB means 1024 bytes, and the SI flag switches to decimal units where 1 KB means 1000 bytes. Word and line counts skip files that are not plain text, so a JPEG shows an empty count while a Rust file shows its real line total.

Suppress the sizes entirely when you only want the shape, with --suppress-size. The tree still draws, and the totals disappear.

How Do You Sort and Shape the Output?

The layout flag changes the shape of the whole tree without changing what it measures. Four layouts exist, and each one answers a different question.

LayoutShapeBest for
RegularRoot at the bottomReading totals fast
InvertedRoot at the top, classic tree shapeFirst-time readers
FlatDu-like paths, no tree linesMatching du output
IflatInverted flatFlat lists, root first
erd -y inverted
erd -y flat -s rsize

Inverted is the layout to reach for when the default feels upside down. It is the traditional tree shape, root at the top, and it is the layout most people expect on their first day.

Sort options go beyond name and size: access, create, and mod sort by timestamp, each with a reverse form. Directory order puts folders first or last, so a flat listing can read like a file manager.

How Does the .erdtree.toml Config File Work?

The config-file lesson is simple: put your defaults in .erdtree.toml once, and every run inherits them. The file lives in your config folder or your home folder, and the README lists both locations for Unix and Windows.

The top-level table is the default config, and named tables are presets you call by name. The README ships three examples, du, ls, and rs, and each one is a one-line preset for a different job.

icons = true
human = true

[du]
disk_usage = "block"
icons = true
layout = "flat"
no-ignore = true
no-git = true
hidden = true
level = 1

Call a preset with --config and its name, as in erd --config du, which equals the full flag list spelled out. Command-line arguments always win over the config file, and --no-config ignores the file for one run without deleting it.

The older .erdtreerc format still works, but the README says it will be deprecated, so start new setups on .erdtree.toml. If both files exist, the old one wins and the TOML file is ignored, which is the one config surprise worth knowing.

A config file is the same idea as an editor config: set it once and forget it. The Zed beginner guide on CodexFuse covers the Rust-built editor that pairs naturally with a Rust-built tree tool, and both keep their settings in plain text files.

erdtree vs tree: What Is Different?

An erdtree vs tree comparison starts with an honest correction: the README says erdtree is not a 1-to-1 port of tree. Judge it as its own tool with a similar spirit, and the differences below are the reason to install it.

Featuretreeerdtree
Disk usageNoYes, per file and folder
Hidden and gitignore rulesNoYes, by default
SortingNoBy size, name, or date
Multi-threaded traversalNoYes, 10 threads by default
IconsNoYes, with a Nerd Font
LayoutsOne tree shapeRegular, inverted, flat, iflat
FilteringNoRegex, glob, and file type

Tree shows structure and stops there, which is exactly right when structure is all you need. Erdtree earns its place when the question is where the disk went, because the sizes are printed next to the names.

The threads default differs between README snapshots: 10 in the 3.1.2 README and 3 in the 3.0.1 snapshot, with 4 in the old 1.x line. The 3.1.2 figure is the one this guide uses, and the exact count matters less than the idea: traversal runs in parallel.

erdtree vs eza: Which One Do You Need?

An erdtree vs eza comparison needs one attribution first: the README compares exa, not eza. Eza is exa's maintained fork, so the comparison below carries the README's exa points forward to eza, and the fork fact comes from a November 2026 roundup.

Eza replaces ls: it lists files with color, icons, and Git status, and its tree flag draws a folder tree. Erdtree replaces tree plus du: it draws the tree and reports the disk usage of every directory, which eza does not do.

The README's own verdict is that the two tools are complementary, and it encourages having both in your toolkit. Use eza when you are listing a folder, and use erdtree when you are auditing one.

Both tools belong to the same terminal-tooling family as the charm tools. The Gum beginner guide on CodexFuse covers the terminal UI toolkit that turns shell scripts into interactive prompts, and it sits in the same lane as these two.

Two more one-line comparisons from the README round out the picture. Dua is the interactive disk-usage browser for when you want to explore, and dust is the closer du cousin with a bar graph, while erdtree stays the static tree-first view.

Seven Mistakes Beginners Make

MistakeWhat happensFix
Typing etOld version 1 binary; commands fail or differInstall 3.1.2 and use erd
Copying apt install erdtreeNo official package; install failsUse cargo, Homebrew, Scoop, or a binary
Wondering where files wentGitignore and hidden defaults hide themUse -i and -. to check
Expecting the root at the topDefault layout puts it at the bottomUse -y inverted
Icons as boxesNo Nerd Font installedInstall one, then use -I
Reading physical as logicalSparse files look smaller than they areUse -d logical for file bytes
Keeping both config filesOld .erdtreerc overrides .erdtree.tomlDelete the old one

No testbed outputs were executed for this guide, so run the commands yourself and watch the output before trusting any of it. The mistakes above are the ones the README and the version history make easy to predict.

from datetime import date
ref = date(2026, 11, 7)
def days(d):
    return (ref - d).days
print("v3.1.2 age days:", days(date(2023, 7, 2)))
print("v3.1.2 age years:", round(days(date(2023, 7, 2)) / 365.25, 1))
print("repo age days:", days(date(2022, 5, 5)))
print("repo age years:", round(days(date(2022, 5, 5)) / 365.25, 1))
print("last push age days:", days(date(2024, 5, 19)))
print("last push age years:", round(days(date(2024, 5, 19)) / 365.25, 1))
print("stars per fork:", round(2604 / 72, 2))
print("open issues per 100 stars:", round(36 / 2604 * 100, 2))
print("v3.0.1 to v3.1.2 days:", (date(2023, 7, 2) - date(2023, 5, 29)).days)
print("v3.1.1 to v3.1.2 days:", (date(2023, 7, 2) - date(2023, 7, 1)).days)
print("v1.1.0 age days:", days(date(2023, 2, 15)))
print("releases per year:", round(21 / (days(date(2022, 5, 5)) / 365.25), 1))
# v3.1.2 age days: 1224
# v3.1.2 age years: 3.4
# repo age days: 1647
# repo age years: 4.5
# last push age days: 902
# last push age years: 2.5
# stars per fork: 36.17
# open issues per 100 stars: 1.38
# v3.0.1 to v3.1.2 days: 34
# v3.1.1 to v3.1.2 days: 1
# v1.1.0 age days: 1361
# releases per year: 4.7

Sources

The erdtree README on lib.rs supplied the install routes, the flags, the config-file format, and the comparisons, and the docs.rs 3.0.1 snapshot supplied the older wording where the two differ. The GitHub API supplied the release and repository figures for solidiquis/erdtree, all fetched on 7 November 2026.

Every number in this guide comes from one of those sources or from a Python calculation shown in the computed block above. No search volumes are quoted, because none were published for this keyword. The release figures are a 7 November 2026 snapshot, and the releases page is the place to check for a newer version.

The page-one field for the primary keyword was thin: README mirrors on docs.rs, a repo listing, and Elden Ring game guides. That thin field is why this guide pins every command to the current 3.1.2 release and corrects the rewrite claim the queue carried.

Frequently Asked Questions

Can I install erdtree without Rust?

Yes. Homebrew, Scoop, and the prebuilt binaries from the releases page need no Rust toolchain at all. Cargo is the only route that needs Rust installed first.

Why is the root at the bottom of the output?

The default regular layout puts the root at the bottom so the total size is the first thing you read. Add -y inverted for the traditional tree shape with the root at the top.

Why are files missing from my tree?

Erdtree respects .gitignore by default and hides dotfiles, so ignored and hidden files never appear and never count toward the totals. Add -i to turn the ignore rules off and -. to show hidden files.

Why do the icons show as boxes?

Icons need a Nerd Font in your terminal, and without those glyphs they render as boxes or question marks. Install a Nerd Font, hook it up to your terminal, and then add -I.

Is erdtree a rewrite of the tree command?

No. The README states plainly that this is not a rewrite of tree and not a 1-to-1 port, and that there are more differences than similarities. It keeps the spirit of tree and adds disk usage, parallel traversal, ignore rules, and layouts.

Featured on Twelve Tools Hunt for Tools Featured on LaunchBuff Launch Llama Tools Launch your MCP Top Web Development Companies in the US - OnToplist.com Designer Listings Listed on SeeWhatNewAI Featured on SubmitMySaas Featured on AI Agents Directory Product Wing SaaS Wheel