Install tree command on centos
tree command is not installed by default in CentOs
[centos@admin ~]$ tree demo_website-bash: tree: command not found
So type the following command to install tree command on RHEL / CentOS and Fedora linux:
[centos@admin ~]$ sudo yum -y install tree
Tree Command Usages
1. By default, if no argument is provided to tree command, it prints tree of current directory.
usr_name:Deep-learning-for-sentiment-analysis admin$ tree
2. To see only directories:
$ tree -d
3. Limit the level or depth of recursion:
$ tree -L 2
4. Show all files including hidden dot files:
$ tree -a -L 2
Stack Trace:
[centos@admin ~]$ sudo yum -y install tree
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink | 9.3 kB 00:00:00
* base: mirrors.fibergrid.in
* epel: d2lzkl7pfhq30w.cloudfront.net
* extras: mirrors.fibergrid.in
* updates: mirrors.fibergrid.in
base | 3.6 kB 00:00:00
epel | 3.2 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
(1/2): epel/x86_64/updateinfo | 937 kB 00:00:00
(2/2): epel/x86_64/primary | 3.6 MB 00:00:00
epel 12735/12735
Resolving Dependencies
--> Running transaction check
---> Package tree.x86_64 0:1.6.0-10.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
============================================================================================================================================================================================================
Package Arch Version Repository Size
============================================================================================================================================================================================================
Installing:
tree x86_64 1.6.0-10.el7 base 46 k
Transaction Summary
============================================================================================================================================================================================================
Install 1 Package
Total download size: 46 k
Installed size: 87 k
Downloading packages:
tree-1.6.0-10.el7.x86_64.rpm | 46 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : tree-1.6.0-10.el7.x86_64 1/1
Verifying : tree-1.6.0-10.el7.x86_64 1/1
Installed:
tree.x86_64 0:1.6.0-10.el7
Complete!