How To Install Tree In Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora, Raspbian And MacOS?
Install tree
-
Debian
apt-get install treeClick to copy -
Ubuntu
apt-get install treeClick to copy -
Alpine OS
apk add treeClick to copy -
Arch Linux
pacman -S treeClick to copy -
Kali Linux
apt-get install treeClick to copy -
CentOS
yum install treeClick to copy -
Fedora
dnf install treeClick to copy -
Raspbian
apt-get install treeClick to copy -
macOS
brew install treeClick to copy
Show the contents of the current directory as a tree.
How to use tree?
Below are few example commands for tree that you can use in the terminal.
Show files and directories up to 'num' levels of depth (where 1 means the current directory):tree -L numClick to copyShow directories only:tree -dClick to copyShow hidden files too:tree -aClick to copyPrint the tree without indentation lines, showing the full path instead (use `-N` to not escape whitespace and special characters):tree -i -fClick to copyPrint the size of each node next to it, in human-readable format:tree -s -hClick to copyFilter the tree using a wildcard (glob) pattern:tree -P *.txtClick to copyIgnore entries that match a wildcard (glob) pattern:tree -I *.txtClick to copy
To install the latest version of tree in your favorite operating system just copy the tree installation command from above and paste it into terminal. It will download and install the latest version of tree 2026 package in your OS.




