How to install Tree on Ubuntu 17.04

To install Tree on Ubuntu 17.04

Tree is Linux command that is used to view the contents of a specified directory. It will list the contents of the directory that is linked in tree like structure. When the directory arguments are given, tree will list all the files and directories in the given parent directory. This tutorial explains the installation of Tree on Ubuntu 17.04.

Installation procedure

To proceed with the installation procedure, add the repo in the target system by running the following command.

root@linuxhelp1:~# add-apt-repository ppa:eugenesan/ppa
 This repository contains collection of customized, updated, ported and backported
packages for two last LTS releases and latest pre-LTS release.
Packages for older releases relocated to ppa:eugenesan/archive or deleted.

+-------------------------------------------------------------------------------------+
| Disclaimer:
+-------------------------------------------------------------------------------------+
* Packages in this a nd related PPAs are for personal use only.
  They developed specifically for several custom environments and may not work for you.
* Usage of packages in this PPA, in some forms, might contradict licenses of software
  packaged in this and related PPAs. End users and administrator are responsible for
  runtime licensing and possible legal consequences.
* Some packages provided with their dependencies while some might require additional
  Ubuntu repositories and external PPAs. Below is the list of

+-------------------------------------------------------------------------------------+
| To add this repository, to your Ubuntu installation, invoke:
+-------------------------------------------------------------------------------------+
$ sudo add-apt-repository ppa:eugenesan/ppa
.
.
.
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keybox ' /tmp/tmppatt4lru/pubring.gpg'  created
gpg: /tmp/tmppatt4lru/trustdb.gpg: trustdb created
gpg: key E61380B28313A596: public key " Launchpad synergy+"  imported
gpg: Total number processed: 1
gpg:               imported: 1
OK

The repositories are successfully added. Now update the repo by executing the apt-get update command.

root@linuxhelp1:~# apt-get update
Hit:1 http://in.archive.ubuntu.com/ubuntu zesty InRelease                           
Hit:2 http://security.ubuntu.com/ubuntu zesty-security InRelease                    
Hit:3 http://in.archive.ubuntu.com/ubuntu zesty-updates InRelease       
Get:4 http://ppa.launchpad.net/eugenesan/ppa/ubuntu zesty InRelease [15.4 kB]
Hit:5 http://in.archive.ubuntu.com/ubuntu zesty-backports InRelease                 
Get:6 http://ppa.launchpad.net/eugenesan/ppa/ubuntu zesty/main amd64 Packages [4,192 B]
Get:7 http://ppa.launchpad.net/eugenesan/ppa/ubuntu zesty/main i386 Packages [4,192 B]
Get:8 http://ppa.launchpad.net/eugenesan/ppa/ubuntu zesty/main Translation-en [3,288 B]
Fetched 27.0 kB in 3s (7,526 B/s)
Reading package lists... Done

The target system has been updated with the required repositories. Install the tree package by running the following command and press y to continue.

root@linuxhelp1:~# apt-get install tree -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  tree
0 upgraded, 1 newly installed, 0 to remove and 246 not upgraded.
Need to get 40.7 kB of archives.
After this operation, 105 kB of additional disk space will be used.
Get:1 http://in.archive.ubuntu.com/ubuntu zesty/universe amd64 tree amd64 1.7.0-5 [40.7 kB]
Fetched 40.7 kB in 2s (16.1 kB/s)
Selecting previously unselected package tree.
(Reading database ... 170562 files and directories currently installed.)
Preparing to unpack .../tree_1.7.0-5_amd64.deb ...
Unpacking tree (1.7.0-5) ...
Setting up tree (1.7.0-5) ...
Processing triggers for man-db (2.7.6.1-2) ...

The tree package has been installed successfully. To use the package, enter the following command and it lists the files and directories stored in the given parent directory.

root@linuxhelp1:~# tree /etc
/etc
??? acpi
?   ??? asus-keyboard-backlight.sh
?   ??? asus-wireless.sh
?   ??? events
?   ?   ??? asus-keyboard-backlight-down
?   ?   ??? asus-keyboard-backlight-up
?   ?   ??? asus-wireless-off
?   ?   ??? asus-wireless-on
?   ?   ??? ibm-wireless
?   ?   ??? lenovo-undock
?   ?   ??? powerbtn
?   ?   ??? thinkpad-cmos
?   ?   ??? tosh-wireless
.
.
.
??? xml
?   ??? catalog
?   ??? catalog.old
?   ??? xml-core.xml
?   ??? xml-core.xml.old
??? zsh_command_not_found

351 directories, 2692 files

The installation of tree package on Ubuntu 17.04 is done without any glitches.

FAQ
Q
What is the functionality of Tree command?
A
When the directory arguments are given, the tree will list all the files and directories in the given parent directory.
Q
What is Tree command?
A
The tree is Linux command that is used to view the contents of a specified directory. It will list the contents of the directory that is linked in a tree-like structure. When the directory arguments are given, the tree will list all the files and directories in the given parent directory.
Q
Is this Tree command will work on windows?
A
yes you can try this Tree command on your command prompt
Q
How to install tree command on centos?
A
To install tree command on centos run the command as follow "yum install tree -y"
Q
Tree command not working on Kali Linux?
A
Execute the command as follow "apt-get install tree". on Kali Linux.