Overview
The standard GNU/Linux tree command is an indispensable terminal utility for inspecting directory structures, examining package layouts, and debugging complex filesystem permissions. Because Android’s default Toybox and Toolbox suites omit the tree binary, developers and system administrators are typically forced to use unwieldy find or ls -R pipelines.
Tree for Android provides a systemless Magisk package containing a pure Bash implementation designed to mimic the classic Linux tree command inside Android root shells.
Supported Flags & Options
The command accepts familiar standard parameters:
tree [OPTIONS] [DIRECTORY]
-a: Show all files (including hidden dotfiles).-d: List directories only; omit individual files.-L <depth>: Limit maximum display depth to specified number of directory levels (e.g.,tree -L 2 /sdcard/).-n: Turn off terminal ANSI color formatting.-i: Force pure ASCII tree lines instead of extended Unicode box-drawing characters.
Example Usage
Inspect a root module directory:
su
tree -L 2 /data/adb/modules/tree
Outputs:
/data/adb/modules/tree
├── META-INF
│ └── com
├── module.prop
└── system
└── bin
└── tree
Installation
- Download
tree-main.zipfrom GitHub releases. - Flash the module in Magisk.
- Reboot your device to access
treein your terminal shell.
