Install tree in Linux

In this article, we cover how to install tree in Linux distributions mainly Debian, Ubuntu, and AlmaLinux. The tree command gets directories listed in a tree-like structure in the standard output.

When we ask for directory details through the tree command-line utility, it would list all the files and sub-directories in that specific directory. Just imagine going through all the files and directories to understand how things have been placed in our system. It would take a lot of resources and time.

Instead, we have the tree command, that can get us the desired outcome in no time.

Note: Following operations require Administrative rights. If you don’t have the rights then, we advise you to contact your System Administrator for assistance.

Install tree in Debian

Open a terminal and update the repository to get the latest version of the package:

# apt update

Next, to install tree:

# apt install tree

Install tree in Ubuntu

The package is available through the standard Ubuntu repository. Update that first, open a terminal and issue the following command:

sudo apt update

To install tree:

sudo apt install tree

Install tree in AlmaLinux

The package tree is a part of the Baseos repository. Package-related information can be found through the following command:

# dnf info tree

To install tree:

# dnf install tree

In conclusion, we have covered here how to install tree in Linux.

Similar Posts