Tree Command in Termux – Installation & Basic Usage

Tree is a simple Linux command-line tool that displays files and folders in a tree-like structure. It makes it easier to explore directories, understand folder layouts, and organize files. You can install and use Tree in Termux to view your Android file system from the terminal using simple commands.

Here’s what you can do with Tree in Termux:

  • Display files and folders in a tree structure.
  • View directory contents easily.
  • Show hidden files and folders.
  • Limit the directory depth.
  • Display only directories.
  • Check files and directory sizes.

Install Tree in Termux

Below are the simple commands to install Tree in Termux. Copy and run each command one by one to install the tool.

Update Termux packages.

pkg update && pkg upgrade -y

Install Tree.

pkg install tree -y

Check the installed version.

tree --version

Tree is now installed and ready to use.

Use Tree in Termux

After installing Tree in Termux, you can use different commands to view files and folders in a tree structure. Below are some useful commands that help you navigate and organize directories.

Display the current directory.

tree

Display a specific directory.

tree /sdcard

Show only directories.

tree -d

Display hidden files and folders.

tree -a

Limit the directory depth to two levels.

tree -L 2

Display full file paths.

tree -f

Show file sizes.

tree -s

Display file permissions.

tree -p

Save the output to a text file.

tree > tree-output.txt

Display help information.

tree --help

Choose the command you want and Tree will display your files and folders inside the Termux terminal.

End Note

Tree is a useful command-line tool for viewing files and folders in a clear tree structure. It makes it easier to understand directory layouts, organize files, and navigate the file system directly from the Termux terminal.

SHARE THIS POST: