Tree command is a useful Linux utility to list files and directories graphically,

Tree command example:
Code:
[root@devopsrun1 ~]# tree
.
├── test
│   ├── files1.txt
│   ├── files8.txt
│   └── files9.txt
├── tester.sh
└── zipfile.zip

1 directory, 5 files

Related: How to install tree command in Linux

There are situations, you want to keep the number of packages to the minimum, such as a docker container. There you can use inbuild Linux commands instead of tree.

#1 alternative for the tree command


Use the find command.

Let us see an example for find command:
Code:
[root@devopsrun1 ~]# find
.
./test
./test/files1.txt
./test/files8.txt
./test/files9.txt
./tester.sh
./zipfile.zip


#2 alternative for the tree command


Use the ls -lR command

Let us see an example usage of ls -lR
Code:
[root@devopsrun1 ~]# ls -lR
.:
-rwxr--r--. 1 root root    0 Jun 29 18:45 tester.sh
-rw-r--r--. 1 root root  990 May 17 17:06 zipfile.zip

./test:
total 0
-rw-r--r-- 1 root root 0 Nov  2 03:10 files1.txt
-rw-r--r-- 1 root root 0 Nov  2 03:10 files8.txt
-rw-r--r-- 1 root root 0 Nov  2 03:10 files9.txt
Hope this helps!