macOS
brew install treelocal Homebrew formula metadata
sudo port install treeMacPorts ports tree · sysutils/tree/Portfile · 来源: api.github.com
安装
brew install treelocal Homebrew formula metadata
sudo port install treeMacPorts ports tree · sysutils/tree/Portfile · 来源: api.github.com
sudo apk add treeAlpine Linux edge package indexes · tree · 来源: dl-cdn.alpinelinux.org
sudo dnf install treeFedora Rawhide package metadata · tree · 来源: dl.fedoraproject.org
nix profile install nixpkgs#treenixpkgs package indexes · pkgs/by-name/tr/tree/package.nix · 来源: api.github.com
sudo pacman -S treeArch Linux sync databases · tree · 来源: geo.mirror.pkgbuild.com
sudo zypper install treeopenSUSE Tumbleweed package metadata · tree · 来源: download.opensuse.org
choco install treeChocolatey community package catalog · tree · 来源: community.chocolatey.org
概览
Display directories as trees (with optional color/HTML output)
历史
tree is the classic Unix-style command that prints directory contents as an indented tree, with options for color, filtering, metadata, and machine-readable output.
Steve Baker's README describes tree as a handy utility he had written earlier to display a directory tree and later released after adding color support. The man page identifies the program as copyright 1996-2026 and describes it as listing directory contents in a tree-like format.
The command grew by accretion in the Unix tradition. Early releases added filtering, modification-time sorting, ownership display, dircolors support, ANSI line drawing, HTML output, output redirection, depth limits, recursive HTML generation, portability fixes, and symlink handling.
Later releases made tree more useful for scripts and modern repositories: XML output, JSON output, UTF-8 handling, file-size sorting, gitignore support, NO_COLOR support, hyperlink output, from-file modes, ACL/SELinux display, and extensive portability fixes across Linux, macOS, Solaris, Cygwin, OS/2, HP NonStop, and other systems.
tree became one of those small commands many users expect even though it is not part of every base system. Its broad package-manager presence reflects that: Homebrew, Debian, Ubuntu, Fedora, Arch, Alpine, MacPorts, Nix, Chocolatey, and others package a compatible `tree` executable.
Its adoption is driven less by a framework ecosystem than by muscle memory: README examples, dotfile screenshots, CI diagnostics, support tickets, and filesystem explanations often become easier once a directory hierarchy can be pasted as text.
Common use is simply `tree` or `tree DIR`, with options such as `-L` for depth, `-a` for hidden files, `-d` for directories only, `-I` or `-P` for filtering, `-J` for JSON, `-X` for XML, and `-H` for HTML.
In package-nerd culture, tree is both a diagnostic tool and a packaging sanity check: after install, after build, or inside a fixture, it gives a compact visual proof of what files landed where.
tree is significant because it turns filesystem shape into a stable text artifact. That makes it unusually useful in package recipes, bug reports, documentation, and tests where `find` is correct but hard to read.
安全态势
doc example: narrow filesystem listing tool.
绿色 风险 · 高 置信度 · appliance
在无人值守的代理使用前,请检查该工具是否读取明文凭据、写入远程状态、发布制品或调用插件。
可执行文件
| 命令 | 类型 | 暴露范围 | 备注 |
|---|---|---|---|
tree | cli | 全局可执行文件 |
新鲜度
这些信号区分页生成时间、软件包管理器活动和上游发布比较。只有存在证据 URL 和可比较版本时,才会提示版本落后。
https://github.com/Old-Man-Programmer/tree
安装元数据
| 软件包键 | brew:tree |
|---|---|
| 版本 | 2.3.2 |
| 软件包管理器 | Homebrew |
| 软件包管理器页面 | https://formulae.brew.sh/formula/tree |
| 主页 | https://oldmanprogrammer.net/source.php?dir=projects/tree |
| 仓库 | https://github.com/Old-Man-Programmer/tree |
| 上游文档 | https://github.com/Old-Man-Programmer/tree#readme |
| 许可证 | GPL-2.0-or-later |
| 源码归档 | https://github.com/Old-Man-Programmer/tree/archive/refs/tags/2.3.2.tar.gz |
| Bottle | 可用 (于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux) |
| Homebrew post-install | 未定义 |
| 服务 | 未声明 |
注册表事实
| Source Database | Homebrew formula API |
|---|---|
| Tap | homebrew/core |
| Full Name | tree |
| Version Scheme | 0 |
| Revision | 0 |
| Bottle Stable Root URL | https://ghcr.io/v2/homebrew/core |
| Deprecated | no |
| Disabled | no |
| Keg Only | no |
| URL Keys |
|
源数据库匹配
匹配项来自外部软件包管理器索引,并与本地 Automic Vault 软件包链接分开显示。
tree 2.2.1-1
displays an indented directory tree, in color
http://oldmanprogrammer.net/source.php?dir=projects/tree
sudo apt install treetree
nix profile install nixpkgs#treetree 2.1.1-2ubuntu3
displays an indented directory tree, in color
http://oldmanprogrammer.net/source.php?dir=projects/tree
sudo apt install treetree 2.3.2-r0
Recursive directory indented listing of files
https://oldmanprogrammer.net/source.php?dir=projects/tree
sudo apk add treetree-doc 2.3.2-r0
Recursive directory indented listing of files (documentation)
https://oldmanprogrammer.net/source.php?dir=projects/tree
sudo apk add tree-doctree 2.3.1-1.fc45
File system tree viewer
https://oldmanprogrammer.net/source.php?dir=projects/tree
sudo dnf install treetree 2.3.2-1
A directory listing program displaying a depth indented list of files
https://gitlab.com/OldManProgrammer/unix-tree
sudo pacman -S treetree 2.3.2-1.1
File listing as a tree
https://oldmanprogrammer.net/tar/tree/
sudo zypper install treetree
sudo port install treetree
choco install tree来源线索
此页面由 av-web 从 scripts/generate-pkg-sqlite.py 生成的私有软件包 SQLite 工件提供。
View the package source record on GitHub.