newtree
A modern reimagining of the classic tree command — designed to actually show you what you're looking for.
tree has been around since the 80s and the interface shows it. newtree keeps everything familiar but fixes the parts that never made sense, and adds the features you'd expect from a modern tool: icons, color, a live-search TUI, and pattern filtering that actually prunes the output instead of lying to you.
Use it as nt for day-to-day use, or newtree to see the help.
Why?
The classic tree command's -P pattern filter is misleading — it still expands every directory, just showing zero matching files inside them:
$ tree ~/project -P "*.rs" -L 3
/home/user/project
├── benches
├── examples
│ ├── basic
│ └── advanced
...
47 directories, 0 files
newtree prunes the tree to only show paths that actually lead to a match:
$ nt ~/project -P .rs -L 3
project
├── src
│ ├── main.rs
│ ├── lib.rs
│ └── utils.rs
├── benches
│ └── bench.rs
├── examples
│ ├── basic.rs
│ └── advanced.rs
...
6 directories, 12 files
Install
# AUR
# From source
Usage
nt [OPTIONS] [PATH]
Listing options
| Flag | Description |
|---|---|
-a |
Show hidden files |
-d |
Directories only |
-l |
Follow symlinks |
-f |
Print full paths |
-x |
Stay on one filesystem |
-L <N> |
Limit depth to N |
-P <PATTERN> |
Show only entries matching pattern |
-I <PATTERN> |
Exclude entries matching pattern |
--prune |
Prune empty directories |
Sorting options
| Flag | Description |
|---|---|
-v |
Natural/version sort |
-t |
Sort by modification time |
-c |
Sort by status change time |
-U |
Unsorted |
-r |
Reverse sort order |
File information
| Flag | Description |
|---|---|
-s |
Show file sizes |
-H |
Human-readable sizes |
-p |
Show permissions |
-D |
Show last modified date |
Icons
Nerd Font icons are shown by default when outputting to a terminal. Requires a Nerd Font in your terminal emulator.
Color
--color=auto (the default) will:
- Use no color when output is piped
- Use simple color when
--permissionsor--dateare active (avoids visual noise) - Use full color otherwise
Output formats
License
MIT